diff --git a/pwdmgr-win/h/VMOpsError.h b/pwdmgr-win/h/VMOpsError.h new file mode 100644 index 00000000000..d4ebe7fc77e --- /dev/null +++ b/pwdmgr-win/h/VMOpsError.h @@ -0,0 +1,37 @@ +// +// VMOpsError.h +// VMOps common error codes +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// +#ifndef __VMOpsError_H__ +#define __VMOpsError_H__ + +#if defined(WIN32) || defined(_WIN32) +#include +#endif + +#ifndef HERROR_DEFINED +#define HERROR_DEFINED + +typedef LONG HERROR; +#define MAKE_ERROR(module, code) \ + (1L << 31 | (module << 16) | code) + +#define HERROR_FAILED(error) \ + ((error & (1 << 31L)) != 0) + +#endif + +// common error codes +#define HERROR_SUCCESS 0 +#define HERROR_FAIL MAKE_ERROR(0, 1) +#define HERROR_NOT_SUPPORTED MAKE_ERROR(0, 2) +#define HERROR_INVALID_PARAMETER MAKE_ERROR(0, 3) +#define HERROR_INSUFFICIENT_BUFFER MAKE_ERROR(0, 4) +#define HERROR_NOT_FOUND MAKE_ERROR(0, 5) + +#endif // !__VMOpsError_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/build/Build.sdf b/pwdmgr-win/win/build/Build.sdf new file mode 100644 index 00000000000..bbbb587a81b Binary files /dev/null and b/pwdmgr-win/win/build/Build.sdf differ diff --git a/pwdmgr-win/win/build/Build.sln b/pwdmgr-win/win/build/Build.sln new file mode 100644 index 00000000000..c6ca64233e9 --- /dev/null +++ b/pwdmgr-win/win/build/Build.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMOps Instance Manager", "..\service\VMOps Instance Manager.vcxproj", "{212919B4-2196-44B8-B026-A351E4D8F19A}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "setup", "..\setup\setup.vdproj", "{2C583661-CC75-40EC-B4DC-4EA562DBCD8C}" + ProjectSection(ProjectDependencies) = postProject + {212919B4-2196-44B8-B026-A351E4D8F19A} = {212919B4-2196-44B8-B026-A351E4D8F19A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Code Signing", "..\codesign\Code Signing.vcxproj", "{2032CBE0-F355-4687-8D7D-F215C0122D88}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {212919B4-2196-44B8-B026-A351E4D8F19A}.Debug|Win32.ActiveCfg = Debug|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Debug|Win32.Build.0 = Debug|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Release|Win32.ActiveCfg = Release|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Release|Win32.Build.0 = Release|Win32 + {2C583661-CC75-40EC-B4DC-4EA562DBCD8C}.Debug|Win32.ActiveCfg = Debug + {2C583661-CC75-40EC-B4DC-4EA562DBCD8C}.Release|Win32.ActiveCfg = Release + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Debug|Win32.ActiveCfg = Debug|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Debug|Win32.Build.0 = Debug|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Release|Win32.ActiveCfg = Release|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pwdmgr-win/win/build/Build.sln.old b/pwdmgr-win/win/build/Build.sln.old new file mode 100644 index 00000000000..f218f20f5a6 --- /dev/null +++ b/pwdmgr-win/win/build/Build.sln.old @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMOps Instance Manager", "..\service\VMOps Instance Manager.vcproj", "{212919B4-2196-44B8-B026-A351E4D8F19A}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "setup", "..\setup\setup.vdproj", "{2C583661-CC75-40EC-B4DC-4EA562DBCD8C}" + ProjectSection(ProjectDependencies) = postProject + {212919B4-2196-44B8-B026-A351E4D8F19A} = {212919B4-2196-44B8-B026-A351E4D8F19A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Code Signing", "..\codesign\Code Signing.vcproj", "{2032CBE0-F355-4687-8D7D-F215C0122D88}" + ProjectSection(ProjectDependencies) = postProject + {2C583661-CC75-40EC-B4DC-4EA562DBCD8C} = {2C583661-CC75-40EC-B4DC-4EA562DBCD8C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {212919B4-2196-44B8-B026-A351E4D8F19A}.Debug|Win32.ActiveCfg = Debug|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Debug|Win32.Build.0 = Debug|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Release|Win32.ActiveCfg = Release|Win32 + {212919B4-2196-44B8-B026-A351E4D8F19A}.Release|Win32.Build.0 = Release|Win32 + {2C583661-CC75-40EC-B4DC-4EA562DBCD8C}.Debug|Win32.ActiveCfg = Debug + {2C583661-CC75-40EC-B4DC-4EA562DBCD8C}.Release|Win32.ActiveCfg = Release + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Debug|Win32.ActiveCfg = Debug|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Debug|Win32.Build.0 = Debug|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Release|Win32.ActiveCfg = Release|Win32 + {2032CBE0-F355-4687-8D7D-F215C0122D88}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pwdmgr-win/win/build/Build.suo b/pwdmgr-win/win/build/Build.suo new file mode 100644 index 00000000000..8583cb7b7f3 Binary files /dev/null and b/pwdmgr-win/win/build/Build.suo differ diff --git a/pwdmgr-win/win/build/UpgradeLog.XML b/pwdmgr-win/win/build/UpgradeLog.XML new file mode 100644 index 00000000000..1a03396fa9e --- /dev/null +++ b/pwdmgr-win/win/build/UpgradeLog.XML @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwdmgr-win/win/codesign/Code Signing.vcproj b/pwdmgr-win/win/codesign/Code Signing.vcproj new file mode 100644 index 00000000000..b4ce763521f --- /dev/null +++ b/pwdmgr-win/win/codesign/Code Signing.vcproj @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pwdmgr-win/win/codesign/Code Signing.vcxproj b/pwdmgr-win/win/codesign/Code Signing.vcxproj new file mode 100644 index 00000000000..9d0557552a5 --- /dev/null +++ b/pwdmgr-win/win/codesign/Code Signing.vcxproj @@ -0,0 +1,71 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2032CBE0-F355-4687-8D7D-F215C0122D88} + Code Signing + MakeFileProj + + + + Makefile + + + Makefile + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\bin\$(Configuration)\ + ..\bin\$(Configuration)\codesign\ + $(ProjectDir)sign-vmops.bat ..\bin\$(Configuration) + + + + WIN32;_DEBUG;$(NMakePreprocessorDefinitions) + $(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + ..\bin\$(Configuration)\ + ..\bin\$(Configuration)\codesign\ + $(ProjectDir)sign-vmops.bat ..\bin\$(Configuration) + + + Code Signing.exe + WIN32;NDEBUG;$(NMakePreprocessorDefinitions) + $(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwdmgr-win/win/codesign/Code Signing.vcxproj.filters b/pwdmgr-win/win/codesign/Code Signing.vcxproj.filters new file mode 100644 index 00000000000..9904ad26149 --- /dev/null +++ b/pwdmgr-win/win/codesign/Code Signing.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + \ No newline at end of file diff --git a/pwdmgr-win/win/codesign/Code Signing.vcxproj.user b/pwdmgr-win/win/codesign/Code Signing.vcxproj.user new file mode 100644 index 00000000000..695b5c78b91 --- /dev/null +++ b/pwdmgr-win/win/codesign/Code Signing.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pwdmgr-win/win/codesign/sign-vmops.bat b/pwdmgr-win/win/codesign/sign-vmops.bat new file mode 100644 index 00000000000..20c9086e24e --- /dev/null +++ b/pwdmgr-win/win/codesign/sign-vmops.bat @@ -0,0 +1,6 @@ +signtool sign /f vmopscert.pfx /p vmops /t http://tsa.starfieldtech.com %1\VMOpsInstanceManager.msi +signtool sign /f vmopscert.pfx /p vmops /t http://tsa.starfieldtech.com %1\VMOpsInstanceManager.msi + + + + diff --git a/pwdmgr-win/win/codesign/signtool.exe b/pwdmgr-win/win/codesign/signtool.exe new file mode 100644 index 00000000000..2eed4ca49d0 Binary files /dev/null and b/pwdmgr-win/win/codesign/signtool.exe differ diff --git a/pwdmgr-win/win/codesign/vmopscert.pfx b/pwdmgr-win/win/codesign/vmopscert.pfx new file mode 100644 index 00000000000..a47241a59f5 Binary files /dev/null and b/pwdmgr-win/win/codesign/vmopscert.pfx differ diff --git a/pwdmgr-win/win/service/ReadMe.txt b/pwdmgr-win/win/service/ReadMe.txt new file mode 100644 index 00000000000..9f8ffdaaa83 --- /dev/null +++ b/pwdmgr-win/win/service/ReadMe.txt @@ -0,0 +1,63 @@ +======================================================================== + ACTIVE TEMPLATE LIBRARY : VMOps Instance Manager Project Overview +======================================================================== + +AppWizard has created this VMOps Instance Manager project for you to use as the starting point for +writing your Service (EXE). + +This file contains a summary of what you will find in each of the files that +make up your project. + +VMOps Instance Manager.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +VMOpsInstanceManager.idl + This file contains the IDL definitions of the type library, the interfaces + and co-classes defined in your project. + This file will be processed by the MIDL compiler to generate: + C++ interface definitions and GUID declarations (VMOpsInstanceManager.h) + GUID definitions (VMOpsInstanceManager_i.c) + A type library (VMOpsInstanceManager.tlb) + Marshaling code (VMOpsInstanceManager_p.c and dlldata.c) + +VMOpsInstanceManager.h + This file contains the C++ interface definitions and GUID declarations of the + items defined in VMOpsInstanceManager.idl. It will be regenerated by MIDL during compilation. + +VMOps Instance Manager.cpp + This file contains the object map and the implementation of WinMain, ServiceMain, and + the service management functions. + +VMOps Instance Manager.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. + + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named VMOps Instance Manager.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file that defines resource IDs. + +///////////////////////////////////////////////////////////////////////////// +Proxy/stub DLL project and module definition file: + +VMOps Instance Managerps.vcproj + This file is the project file for building a proxy/stub DLL if necessary. + The IDL file in the main project must contain at least one interface and you must + first compile the IDL file before building the proxy/stub DLL. This process generates + dlldata.c, VMOpsInstanceManager_i.c and VMOpsInstanceManager_p.c which are required + to build the proxy/stub DLL. + +VMOps Instance Managerps.def + This module definition file provides the linker with information about the exports + required by the proxy/stub. + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/Resource.h b/pwdmgr-win/win/service/Resource.h new file mode 100644 index 00000000000..345678f2860 --- /dev/null +++ b/pwdmgr-win/win/service/Resource.h @@ -0,0 +1,18 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by VMOps Instance Manager.rc +// + +#define IDS_SERVICENAME 100 +#define IDR_VMOPSINSTANCEMANAGER 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/pwdmgr-win/win/service/ThreadUtil.cpp b/pwdmgr-win/win/service/ThreadUtil.cpp new file mode 100644 index 00000000000..4f4b57d789e --- /dev/null +++ b/pwdmgr-win/win/service/ThreadUtil.cpp @@ -0,0 +1,133 @@ +// +// ThreadUtl.h +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// + +#include "ThreadUtil.h" + +#include + +using namespace VMOps; + +///////////////////////////////////////////////////////////////////////////// +// CCriticalSection +// +CCriticalSection::CCriticalSection() +{ + InitializeCriticalSection(&m_cs); +} + +CCriticalSection::~CCriticalSection() +{ + DeleteCriticalSection(&m_cs); +} + +void CCriticalSection::Lock() +{ + EnterCriticalSection(&m_cs); +} + +void CCriticalSection::Unlock() +{ + LeaveCriticalSection(&m_cs); +} + +///////////////////////////////////////////////////////////////////////////// +// CThread +// +CThread::CThread() +{ + m_hThread = NULL; + m_idThread = 0; + + m_hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + _ASSERTE(m_hStopEvent); +} + +CThread::~CThread() +{ + _ASSERTE(m_hStopEvent); + if(m_hStopEvent) + CloseHandle(m_hStopEvent); + m_hStopEvent = NULL; + + _ASSERTE(m_hThread == NULL); + if(m_hThread) + { + TerminateThread(m_hThread, 0); + CloseHandle(m_hThread); + } + m_hThread = NULL; +} + +BOOL CThread::Create(DWORD dwCreationFlag) +{ + _ASSERTE(m_hThread == NULL); + + m_hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, + (LPVOID)this, dwCreationFlag, &m_idThread); + _ASSERTE(m_hThread); + _ASSERTE(m_idThread != 0); + + return m_hThread != NULL; +} + +BOOL CThread::Stop(DWORD dwTimeOut) +{ + _ASSERTE(m_idThread != GetCurrentThreadId()); + if(m_idThread == GetCurrentThreadId()) + { + // this may cause dead-lock if we wait here, + // so we just raise the signal + // and return FALSE to indicate of that + SetEvent(m_hStopEvent); + return FALSE; + } + + if(m_hThread) + { + BOOL bReturn = FALSE; + + _ASSERTE(m_hStopEvent); + SetEvent(m_hStopEvent); + if(WaitForSingleObject(m_hThread, dwTimeOut) == WAIT_OBJECT_0) + { + bReturn = TRUE; + + // restore to initial state + if(m_hThread != NULL) + { + CloseHandle(m_hThread); + m_hThread = NULL; + } + m_idThread = 0; + ResetEvent(m_hStopEvent); + } + + return bReturn; + } + return TRUE; +} + +BOOL CThread::IsSelfThread() +{ + return m_idThread == GetCurrentThreadId(); +} + +DWORD CThread::ThreadRun() +{ + return 0; +} + +DWORD WINAPI CThread::ThreadProc(LPVOID lpvParam) +{ + _ASSERTE(lpvParam); + CThread* pThread = (CThread*)lpvParam; + + return pThread->ThreadRun(); +} + +///////////////////////////////////////////////////////////////////////////// + diff --git a/pwdmgr-win/win/service/ThreadUtil.h b/pwdmgr-win/win/service/ThreadUtil.h new file mode 100644 index 00000000000..8c42ae1d6c0 --- /dev/null +++ b/pwdmgr-win/win/service/ThreadUtil.h @@ -0,0 +1,105 @@ +// +// ThreadUtl.h +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// + +#ifndef __ThreadUtil_H__ +#define __ThreadUtil_H__ + +#include + +namespace VMOps { + +///////////////////////////////////////////////////////////////////////////// +// class diagram +// +class CLockable; + class CCriticalSection; +class CLock; +class CThread; + +///////////////////////////////////////////////////////////////////////////// +// CLockable +// +class CLockable +{ +public : + virtual void Lock() = 0; + virtual void Unlock() = 0; +}; + +///////////////////////////////////////////////////////////////////////////// +// CLock +// +class CLock +{ +public : + CLock(CLockable& lockableObj) : m_lockableObj(lockableObj) + { + m_lockableObj.Lock(); + } + + ~CLock() + { + m_lockableObj.Unlock(); + } + +protected : + CLockable& m_lockableObj; +}; + +///////////////////////////////////////////////////////////////////////////// +// CCriticalSection +// +class CCriticalSection : public CLockable +{ +public : + CCriticalSection(); + virtual ~CCriticalSection(); + +public : + virtual void Lock(); + virtual void Unlock(); + +protected : + CRITICAL_SECTION m_cs; +}; + + +// Simple thread implementation +class CThread +{ +public : + CThread(); + virtual ~CThread(); + +public : + BOOL Create(DWORD dwCreationFlag); + BOOL Stop(DWORD dwTimeOut = INFINITE); + + HANDLE GetThreadHandle() { return m_hThread; } + DWORD GetThreadId() { return m_idThread; } + BOOL IsSelfThread(); + +protected : + HANDLE GetStopEventHandle() { return m_hStopEvent; } + +public : + virtual DWORD ThreadRun(); + +public : + static DWORD WINAPI ThreadProc(LPVOID lpvParam); + +protected : + HANDLE m_hStopEvent; + HANDLE m_hThread; + DWORD m_idThread; +}; + +} + +#endif // !__ThreadUtil_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.aps b/pwdmgr-win/win/service/VMOps Instance Manager.aps new file mode 100644 index 00000000000..c731c98bf7a Binary files /dev/null and b/pwdmgr-win/win/service/VMOps Instance Manager.aps differ diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.cpp b/pwdmgr-win/win/service/VMOps Instance Manager.cpp new file mode 100644 index 00000000000..3370f532724 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.cpp @@ -0,0 +1,148 @@ +// VMOps Instance Manager.cpp : Implementation of WinMain + +#include "stdafx.h" +#include "resource.h" +#include "VMOpsInstanceManager_i.h" + +#include +#include + +#include "VMOpsServiceImpl.h" +using namespace VMOps; + +class CVMOpsInstanceManagerModule : public CAtlServiceModuleT< CVMOpsInstanceManagerModule, IDS_SERVICENAME > +{ +public : + DECLARE_LIBID(LIBID_VMOpsInstanceManagerLib) + DECLARE_REGISTRY_APPID_RESOURCEID(IDR_VMOPSINSTANCEMANAGER, "{7C7E823B-66C7-4D1C-8DE3-9616605B1768}") + HRESULT InitializeSecurity() throw() + { + // TODO : Call CoInitializeSecurity and provide the appropriate security settings for + // your service + // Suggested - PKT Level Authentication, + // Impersonation Level of RPC_C_IMP_LEVEL_IDENTIFY + // and an appropiate Non NULL Security Descriptor. + return S_OK; + } + + HRESULT PreMessageLoop(int nShowCmd = SW_HIDE) throw() + { + CAtlServiceModuleT< CVMOpsInstanceManagerModule, IDS_SERVICENAME >::PreMessageLoop(nShowCmd); + + // m_serviceProvider.SetPassword(_T("Administrator"), _T("password@vmops.com")); + CLogger::GetInstance()->Initialize(); + m_serviceProvider.Start(); + + return S_OK; + } + + HRESULT PostMessageLoop() throw() + { + CAtlServiceModuleT< CVMOpsInstanceManagerModule, IDS_SERVICENAME >::PostMessageLoop(); + m_serviceProvider.Stop(); + CLogger::GetInstance()->Cleanup(); + return S_OK; + } + + // override to install the service as auto-start service + inline HRESULT RegisterAppId(bool bService = false) throw() + { + if (!Uninstall()) + return E_FAIL; + + HRESULT hr = UpdateRegistryAppId(TRUE); + if (FAILED(hr)) + return hr; + + CRegKey keyAppID; + LONG lRes = keyAppID.Open(HKEY_CLASSES_ROOT, _T("AppID"), KEY_WRITE); + if (lRes != ERROR_SUCCESS) + return AtlHresultFromWin32(lRes); + + CRegKey key; + + lRes = key.Create(keyAppID, GetAppIdT()); + if (lRes != ERROR_SUCCESS) + return AtlHresultFromWin32(lRes); + + key.DeleteValue(_T("LocalService")); + + if (!bService) + return S_OK; + + key.SetStringValue(_T("LocalService"), m_szServiceName); + + // Create service + if (!InstallAsAutoService()) + return E_FAIL; + return S_OK; + } + + BOOL InstallAsAutoService() throw() + { + if (IsInstalled()) + return TRUE; + + // Get the executable file path + TCHAR szFilePath[MAX_PATH + _ATL_QUOTES_SPACE]; + DWORD dwFLen = ::GetModuleFileName(NULL, szFilePath + 1, MAX_PATH); + if( dwFLen == 0 || dwFLen == MAX_PATH ) + return FALSE; + + // Quote the FilePath before calling CreateService + szFilePath[0] = _T('\"'); + szFilePath[dwFLen + 1] = _T('\"'); + szFilePath[dwFLen + 2] = 0; + + SC_HANDLE hSCM = ::OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (hSCM == NULL) + { + TCHAR szBuf[1024]; + if (AtlLoadString(ATL_SERVICE_MANAGER_OPEN_ERROR, szBuf, 1024) == 0) +#ifdef UNICODE + Checked::wcscpy_s(szBuf, _countof(szBuf), _T("Could not open Service Manager")); +#else + Checked::strcpy_s(szBuf, _countof(szBuf), _T("Could not open Service Manager")); +#endif + MessageBox(NULL, szBuf, m_szServiceName, MB_OK); + return FALSE; + } + + SC_HANDLE hService = ::CreateService( + hSCM, m_szServiceName, _T("VMOps Instance Manager"), + SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, + /*SERVICE_DEMAND_START*/ SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, + szFilePath, NULL, NULL, _T("RPCSS\0"), NULL, NULL); + + if (hService == NULL) + { + ::CloseServiceHandle(hSCM); + TCHAR szBuf[1024]; + if (AtlLoadString(ATL_SERVICE_START_ERROR, szBuf, 1024) == 0) +#ifdef UNICODE + Checked::wcscpy_s(szBuf, _countof(szBuf), _T("Could not create service")); +#else + Checked::strcpy_s(szBuf, _countof(szBuf), _T("Could not create service")); +#endif + MessageBox(NULL, szBuf, m_szServiceName, MB_OK); + return FALSE; + } + + ::CloseServiceHandle(hService); + ::CloseServiceHandle(hSCM); + return TRUE; + } + +private : + CVMOpsServiceProvider m_serviceProvider; +}; + +CVMOpsInstanceManagerModule _AtlModule; + +// +extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, + LPTSTR /*lpCmdLine*/, int nShowCmd) +{ + return _AtlModule.WinMain(nShowCmd); +} + diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.rc b/pwdmgr-win/win/service/VMOps Instance Manager.rc new file mode 100644 index 00000000000..6b79f9a37b1 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.rc @@ -0,0 +1,126 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "1 TYPELIB ""VMOpsInstanceManager.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "VMOps Inc." + VALUE "FileDescription", "VMOps Instance Management Service" + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "VMOps Instance Manager.exe" + VALUE "LegalCopyright", "(c) VMOps Inc. All rights reserved." + VALUE "OriginalFilename", "VMOps Instance Manager.exe" + VALUE "ProductName", "VMOps Cloud Service" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_VMOPSINSTANCEMANAGER REGISTRY "VMOps Instance Manager.rgs" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_SERVICENAME "VMOpsInstanceMgr" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "VMOpsInstanceManager.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.rgs b/pwdmgr-win/win/service/VMOps Instance Manager.rgs new file mode 100644 index 00000000000..e5fa53e86e4 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.rgs @@ -0,0 +1,11 @@ +HKCR +{ + NoRemove AppID + { + '%APPID%' = s 'VMOpsInstanceManager' + 'vmopsservice.exe' + { + val AppID = s '%APPID%' + } + } +} diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.vcproj b/pwdmgr-win/win/service/VMOps Instance Manager.vcproj new file mode 100644 index 00000000000..bdfee9370b7 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.vcproj @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj new file mode 100644 index 00000000000..75c0d03e509 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj @@ -0,0 +1,195 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {212919B4-2196-44B8-B026-A351E4D8F19A} + VMOps Instance Manager + AtlProj + + + + Application + Static + Unicode + + + Application + Static + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\bin\debug\ + ..\bin\debug\service\ + true + true + ..\bin\release\ + ..\bin\release\service\ + true + false + + + + _DEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)VMOpsInstanceManager.tlb + VMOpsInstanceManager_i.h + + + VMOpsInstanceManager_i.c + VMOpsInstanceManager_p.c + true + + + Disabled + ..\..\h;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_DEBUG;_ATL_NO_COM_SUPPORT;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + netapi32.lib;iphlpapi.lib;wininet.lib;%(AdditionalDependencies) + $(OutDir)vmopsservice.exe + true + Windows + MachineX86 + + + Performing registration + "$(TargetPath)" /RegServer + + + + + NDEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)VMOpsInstanceManager.tlb + VMOpsInstanceManager_i.h + + + VMOpsInstanceManager_i.c + VMOpsInstanceManager_p.c + true + + + MaxSpeed + ..\..\h;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;NDEBUG;_ATL_NO_COM_SUPPORT;%(PreprocessorDefinitions) + MultiThreaded + Use + Level3 + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + netapi32.lib;iphlpapi.lib;wininet.lib;%(AdditionalDependencies) + $(OutDir)vmopsservice.exe + true + Windows + true + true + MachineX86 + + + Performing registration + "$(TargetPath)" /RegServer + + + + + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.filters b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.filters new file mode 100644 index 00000000000..7e20baefdb8 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.filters @@ -0,0 +1,83 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {2cbb01a5-ccfa-49ef-8fa6-a09acdc1f899} + False + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Generated Files + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Generated Files + + + + + Resource Files + + + + + Resource Files + + + + \ No newline at end of file diff --git a/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.user b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.user new file mode 100644 index 00000000000..695b5c78b91 --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Manager.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pwdmgr-win/win/service/VMOps Instance ManagerPS.vcproj b/pwdmgr-win/win/service/VMOps Instance ManagerPS.vcproj new file mode 100644 index 00000000000..935bf3043ef --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance ManagerPS.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pwdmgr-win/win/service/VMOps Instance Managerps.def b/pwdmgr-win/win/service/VMOps Instance Managerps.def new file mode 100644 index 00000000000..7efeba1df6b --- /dev/null +++ b/pwdmgr-win/win/service/VMOps Instance Managerps.def @@ -0,0 +1,8 @@ + +LIBRARY "VMOps Instance ManagerPS" + +EXPORTS + DllGetClassObject PRIVATE + DllCanUnloadNow PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/pwdmgr-win/win/service/VMOpsInstanceManager.idl b/pwdmgr-win/win/service/VMOpsInstanceManager.idl new file mode 100644 index 00000000000..473f18056c9 --- /dev/null +++ b/pwdmgr-win/win/service/VMOpsInstanceManager.idl @@ -0,0 +1,18 @@ +// VMOpsInstanceManager.idl : IDL source for VMOps Instance Manager +// + +// This file will be processed by the MIDL tool to +// produce the type library (VMOpsInstanceManager.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + +[ + uuid(5F9080A7-CF0E-4EC5-B461-9B817882DF23), + version(1.0), + helpstring("VMOpsInstanceManager 1.0 Type Library") +] +library VMOpsInstanceManagerLib +{ + importlib("stdole2.tlb"); +}; diff --git a/pwdmgr-win/win/service/VMOpsLogger.cpp b/pwdmgr-win/win/service/VMOpsLogger.cpp new file mode 100644 index 00000000000..aa716a71007 --- /dev/null +++ b/pwdmgr-win/win/service/VMOpsLogger.cpp @@ -0,0 +1,116 @@ +// +// VMOpsLogger.cpp +// VMOps instance manager implementation +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// +#include "VMOpsServiceImpl.h" + +#include + +#define MAX_LOGFILE_SIZE 1000000 // 1M + +using namespace VMOps; + +///////////////////////////////////////////////////////////////////////////// +// CLogger +// +CLogger* CLogger::s_pInstance = NULL; + +CLogger::CLogger() +{ + _ASSERTE(s_pInstance == NULL); + + s_pInstance = this; + m_pFile = NULL; +} + +CLogger::~CLogger() +{ + if(m_pFile != NULL) + fclose(m_pFile); +} + +BOOL CLogger::Initialize() +{ + TCHAR achPath[_MAX_PATH]; + TCHAR achDrive[_MAX_DRIVE]; + TCHAR achDir[_MAX_DIR]; + + GetModuleFileName(NULL, achPath, _MAX_PATH); + _tsplitpath(achPath, achDrive, achDir, NULL, NULL); + _tmakepath(achPath, achDrive, achDir, _T("vmops"), _T(".log")); + m_pFile = _tfopen(achPath, _T("a+")); + + return m_pFile != NULL; +} + +void CLogger::RotateLog() +{ + TCHAR achPath[_MAX_PATH]; + TCHAR achDrive[_MAX_DRIVE]; + TCHAR achDir[_MAX_DIR]; + + GetModuleFileName(NULL, achPath, _MAX_PATH); + _tsplitpath(achPath, achDrive, achDir, NULL, NULL); + _tmakepath(achPath, achDrive, achDir, _T("vmops"), _T(".log")); + + TCHAR achPath2[_MAX_PATH]; + GetModuleFileName(NULL, achPath2, _MAX_PATH); + _tsplitpath(achPath2, achDrive, achDir, NULL, NULL); + _tmakepath(achPath2, achDrive, achDir, _T("vmops"), _T(".log.bak")); + + MoveFileEx(achPath, achPath2, MOVEFILE_REPLACE_EXISTING); +} + +void CLogger::Cleanup() +{ + if(m_pFile != NULL) + fclose(m_pFile); + m_pFile = NULL; +} + +void CLogger::Log(LPCSTR lpszCategory, LPCSTR lpszFormat, ...) +{ + CLock lock(m_lock); + + if(m_pFile != NULL) + { + SYSTEMTIME tm; + DWORD dwProcessId = GetCurrentProcessId(); + DWORD dwThreadId = GetCurrentThreadId(); + GetSystemTime(&tm); + + fprintf(m_pFile, "[%02u/%02u/%04u %02u:%02u:%02u.%03u][pid:%lu][tid:%lu][%s] ", + tm.wMonth, tm.wDay, tm.wYear, tm.wHour, tm.wMinute, tm.wSecond, tm.wMilliseconds, + dwProcessId, dwThreadId, lpszCategory); + + va_list argMark; + va_start(argMark, lpszFormat); + vfprintf(m_pFile, lpszFormat, argMark); + va_end(argMark); + fprintf(m_pFile, "\n"); + fflush(m_pFile); + + if(ftell(m_pFile) > MAX_LOGFILE_SIZE) + { + fclose(m_pFile); + m_pFile = NULL; + + RotateLog(); + + // reopen it + Initialize(); + } + } +} + +CLogger* CLogger::GetInstance() +{ + return s_pInstance; +} + +CLogger g_logger; + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/VMOpsServiceImpl.h b/pwdmgr-win/win/service/VMOpsServiceImpl.h new file mode 100644 index 00000000000..7e3ab5e1540 --- /dev/null +++ b/pwdmgr-win/win/service/VMOpsServiceImpl.h @@ -0,0 +1,100 @@ +// +// VMOpsServiceImpl.h +// VMOps instance manager implementation +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// +#ifndef __VMOpsServiceImpl_H__ +#define __VMOpsServiceImpl_H__ + +#include "VMOpsError.h" +#include "ThreadUtil.h" + +#include + +namespace VMOps { + +///////////////////////////////////////////////////////////////////////////// +// class diagram +// +class CVMOpsServiceProvider; +class CThread; + class CVMOpsStartupWatcher; + +class CLogger; + +///////////////////////////////////////////////////////////////////////////// +// CVMOpsServiceProvider +// +class CVMOpsServiceProvider +{ +public : + CVMOpsServiceProvider(); + ~CVMOpsServiceProvider(); + +public : + HERROR SetPassword(LPCTSTR lpszUserName, LPCTSTR lpszPassword); + HERROR GetDefaultGateway(LPSTR lpszBuf, LPDWORD pdwLength); + HERROR SimpleHttpGet(LPCTSTR lpszUrl, LPCTSTR lpszHeaders, + LPVOID pOutputBuffer, DWORD dwBytesToRead, DWORD* pdwBytesRead); + + HERROR Start(); + HERROR Stop(); + +protected : + CVMOpsStartupWatcher* m_pWatcher; +}; + +///////////////////////////////////////////////////////////////////////////// +// CVMOpsStartupWatcher +// +class CVMOpsStartupWatcher : public CThread +{ +public : + CVMOpsStartupWatcher(CVMOpsServiceProvider* pProvider); + virtual ~CVMOpsStartupWatcher(); + +public : + CVMOpsServiceProvider* GetProvider() { return m_pProvider; } + +protected : + virtual DWORD ThreadRun(); + + BOOL DoStartupConfig(); + BOOL GetDomRUrl(LPTSTR lpszUrl); + +protected : + CVMOpsServiceProvider* m_pProvider; +}; + +///////////////////////////////////////////////////////////////////////////// +// CLogger +// A simple logger for internal use +// +class CLogger +{ +public : + CLogger(); + ~CLogger(); + +public : + static CLogger* GetInstance(); + BOOL Initialize(); + void RotateLog(); + void Cleanup(); + + void Log(LPCSTR lpszCategory, LPCSTR lpszFormat, ...); + +private : + CCriticalSection m_lock; + FILE* m_pFile; + +private : + static CLogger* s_pInstance; +}; + +} +#endif // __VMOpsServiceProvider_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/VMOpsServiceProvider.cpp b/pwdmgr-win/win/service/VMOpsServiceProvider.cpp new file mode 100644 index 00000000000..156be6e2d53 --- /dev/null +++ b/pwdmgr-win/win/service/VMOpsServiceProvider.cpp @@ -0,0 +1,183 @@ +// +// VMOpsServiceProvider.cpp +// VMOps instance manager implementation +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// +#include "VMOpsServiceImpl.h" + +#include +#include + +#include +#include +#include +#include + +using namespace VMOps; + +CVMOpsServiceProvider::CVMOpsServiceProvider() +{ + m_pWatcher = NULL; +} + +CVMOpsServiceProvider::~CVMOpsServiceProvider() +{ + if(m_pWatcher != NULL) + delete m_pWatcher; +} + +HERROR CVMOpsServiceProvider::SetPassword(LPCTSTR lpszUserName, LPCTSTR lpszPassword) +{ + _ASSERTE(lpszUserName != NULL); + + USES_CONVERSION; + USER_INFO_1003 ui; + ui.usri1003_password = T2W((LPTSTR)lpszPassword); + + NET_API_STATUS status = NetUserSetInfo(NULL, T2W((LPTSTR)lpszUserName), 1003, (LPBYTE)&ui, NULL); + if(status != NERR_Success) + { + switch(status) + { + case ERROR_ACCESS_DENIED : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : ERROR_ACCESS_DENIED"); + break; + + case ERROR_INVALID_PARAMETER : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : ERROR_INVALID_PARAMETER"); + break; + + case NERR_InvalidComputer : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_InvalidComputer"); + break; + + case NERR_NotPrimary : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_NotPrimary"); + break; + + case NERR_SpeGroupOp : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_SpeGroupOp"); + break; + + case NERR_LastAdmin : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_LastAdmin"); + break; + + case NERR_BadPassword : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_BadPassword"); + break; + + case NERR_PasswordTooShort : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_PasswordTooShort"); + break; + + case NERR_UserNotFound : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : NERR_UserNotFound"); + break; + + default : + CLogger::GetInstance()->Log("ERROR", "SetPassword failed with error : 0x%lx", (DWORD)status); + break; + } + return HERROR_FAIL; + } + return HERROR_SUCCESS; +} + +HERROR CVMOpsServiceProvider::GetDefaultGateway(LPSTR lpszBuf, LPDWORD pdwLength) +{ + _ASSERTE(pdwLength); + + PIP_ADAPTER_INFO pAdapter = NULL; + DWORD dwBufLength = 0; + + GetAdaptersInfo(NULL, &dwBufLength); + if(dwBufLength == 0) + return HERROR_FAIL; + + pAdapter = (PIP_ADAPTER_INFO)new BYTE[dwBufLength]; + if ((GetAdaptersInfo( pAdapter, &dwBufLength)) != NO_ERROR) + { + delete [] (LPBYTE)pAdapter; + return HERROR_FAIL; + } + + HERROR hReturn = HERROR_NOT_FOUND; + while (pAdapter) + { + if(pAdapter->GatewayList.IpAddress.String != NULL && pAdapter->GatewayList.IpAddress.String[0] != 0) + { + if(*pdwLength < strlen(pAdapter->GatewayList.IpAddress.String) + 1) + { + *pdwLength = strlen(pAdapter->GatewayList.IpAddress.String) + 1; + + hReturn = HERROR_INSUFFICIENT_BUFFER; + } else { + _ASSERTE(lpszBuf); + + strcpy(lpszBuf, pAdapter->GatewayList.IpAddress.String); + hReturn = HERROR_SUCCESS; + } + + break; + } + pAdapter = pAdapter->Next; + } + + delete [] (LPBYTE)pAdapter; + return hReturn; +} + +HERROR CVMOpsServiceProvider::SimpleHttpGet(LPCTSTR lpszUrl, LPCTSTR lpszHeaders, + LPVOID pOutputBuffer, DWORD dwBytesToRead, DWORD* pdwBytesRead) +{ + HINTERNET hInternet = InternetOpen(_T("VMOps Instance Manager"), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + if(hInternet == NULL) + return HERROR_FAIL; + + HINTERNET hConnection = InternetOpenUrl(hInternet, lpszUrl, lpszHeaders, -1, + INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_UI, NULL); + if(hConnection == NULL) + { + InternetCloseHandle(hInternet); + return HERROR_FAIL; + } + + if(!InternetReadFile(hConnection, pOutputBuffer, dwBytesToRead, pdwBytesRead)) + { + InternetCloseHandle(hConnection); + InternetCloseHandle(hInternet); + return HERROR_FAIL; + } + + InternetCloseHandle(hConnection); + InternetCloseHandle(hInternet); + return HERROR_SUCCESS; +} + +HERROR CVMOpsServiceProvider::Start() +{ + CLogger::GetInstance()->Log("INFO", "VMOps instance Management Service started"); + + m_pWatcher = new CVMOpsStartupWatcher(this); + m_pWatcher->Create(0); + + CLogger::GetInstance()->Log("INFO", "VMOps instance Management startup watcher started"); + return HERROR_SUCCESS; +} + +HERROR CVMOpsServiceProvider::Stop() +{ + if(m_pWatcher != NULL) + { + m_pWatcher->Stop(); + CLogger::GetInstance()->Log("INFO", "VMOps instance Management startup watcher stopped"); + } + + CLogger::GetInstance()->Log("INFO", "VMOps instance Management Service stopped"); + return HERROR_SUCCESS; +} + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/VMOpsStartupWatcher.cpp b/pwdmgr-win/win/service/VMOpsStartupWatcher.cpp new file mode 100644 index 00000000000..9794797c600 --- /dev/null +++ b/pwdmgr-win/win/service/VMOpsStartupWatcher.cpp @@ -0,0 +1,170 @@ +// +// VMOpsStartupWatcher.cpp +// VMOps instance manager implementation +// +// Copyright (C) VMOps Inc. +// All rights reserved. +// + +#include "VMOpsServiceImpl.h" +#include + +using namespace VMOps; + +#define RETRY_INTERVAL 1000 +#define MAX_WAIT_TIME 1800000 // 30 minutes + +///////////////////////////////////////////////////////////////////////////// +// Helpers +// +BOOL IsMiniSetupInProgess() +{ + CRegKey key; + + if(key.Open(HKEY_LOCAL_MACHINE, _T("SYSTEM\\Setup"), KEY_READ) == ERROR_SUCCESS) + { + DWORD dwValue = 0; + key.QueryDWORDValue(_T("SystemSetupInProgress"), dwValue); + if(dwValue != 0) + { + CLogger::GetInstance()->Log("INFO", "Mini-setup is in pregress"); + } + + return dwValue != 0; + } + else + { + CLogger::GetInstance()->Log("INFO", "Mini-setup information is not present"); + } + + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////// +// CVMOpsStartupWatcher +// +CVMOpsStartupWatcher::CVMOpsStartupWatcher(CVMOpsServiceProvider* pProvider) +{ + _ASSERTE(pProvider); + m_pProvider = pProvider; +} + +CVMOpsStartupWatcher::~CVMOpsStartupWatcher() +{ +} + +DWORD CVMOpsStartupWatcher::ThreadRun() +{ + DWORD dwStartTick = GetTickCount(); + while(TRUE) + { + if(WaitForSingleObject(GetStopEventHandle(), RETRY_INTERVAL) == WAIT_OBJECT_0) + break; + + if(DoStartupConfig()) + break; + + if(GetTickCount() - dwStartTick > MAX_WAIT_TIME) + { + CLogger::GetInstance()->Log("WARN", "Unable to contact default gateway, give up trying after 30 minutes"); + break; + } + } + + return 0; +} + +BOOL CVMOpsStartupWatcher::GetDomRUrl(LPTSTR lpszUrl) +{ + // asumming we have enough space in lpszUrl + char achBuf[256]; + achBuf[0] = 0; + DWORD dwLength = sizeof(achBuf); + if(m_pProvider->GetDefaultGateway(achBuf, &dwLength) == HERROR_SUCCESS) + { + USES_CONVERSION; + + char achUrl[256]; + sprintf(achUrl, "http://%s:8080/", achBuf); + + lstrcpy(lpszUrl, A2T(achUrl)); + return TRUE; + } + return FALSE; +} + +BOOL CVMOpsStartupWatcher::DoStartupConfig() +{ + USES_CONVERSION; + + if(IsMiniSetupInProgess()) + { + CLogger::GetInstance()->Log("INFO", "Mini-setup is detected, skip VMOps startup configuratin process"); + return TRUE; + } + + TCHAR achUrl[256]; + char achResult[256]; + + memset(achUrl, 0, sizeof(achUrl)); + GetDomRUrl(achUrl); + + if(achUrl[0] != 0) + { + CLogger::GetInstance()->Log("INFO", "Contact default gateway at : %ws", achUrl); + + memset(achResult, 0, sizeof(achResult)); + DWORD dwBytesToRead = sizeof(achResult) - 1; + DWORD dwBytesRead = 0; + if(m_pProvider->SimpleHttpGet(achUrl, _T("DomU_Request: send_my_password"), + achResult, dwBytesToRead, &dwBytesRead) == HERROR_SUCCESS) + { + achResult[dwBytesRead] = 0; + //Trim whitespace at tail + int nPos = strlen(achResult) - 1; + while(nPos > 0) + { + if(strchr(" \t\r\n", achResult[nPos]) != NULL) + achResult[nPos] = 0; + else + break; + + nPos--; + } + + if(strcmp(achResult, "saved_password") != 0) + { + CLogger::GetInstance()->Log("INFO", "Need to set new password for this VM. First letter in password : %c", achResult[0]); + + if(m_pProvider->SetPassword(_T("Administrator"), A2T(achResult)) == HERROR_SUCCESS) + { + CLogger::GetInstance()->Log("INFO", "New password has been set for this VM"); + + memset(achResult, 0, sizeof(achResult)); + m_pProvider->SimpleHttpGet(achUrl, _T("DomU_Request: saved_password"), + achResult, dwBytesToRead, &dwBytesRead); + } + else + { + CLogger::GetInstance()->Log("ERROR", "Error to set new password"); + return FALSE; + } + } + else + { + CLogger::GetInstance()->Log("INFO", "No need to set password"); + } + } + else + { + CLogger::GetInstance()->Log("ERROR", "Unable to contact default gateway at : %ws", achUrl); + return FALSE; + } + + return TRUE; + } + + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////// diff --git a/pwdmgr-win/win/service/stdafx.cpp b/pwdmgr-win/win/service/stdafx.cpp new file mode 100644 index 00000000000..dbe6603cdde --- /dev/null +++ b/pwdmgr-win/win/service/stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp : source file that includes just the standard includes +// VMOps Instance Manager.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" diff --git a/pwdmgr-win/win/service/stdafx.h b/pwdmgr-win/win/service/stdafx.h new file mode 100644 index 00000000000..22db5e297d0 --- /dev/null +++ b/pwdmgr-win/win/service/stdafx.h @@ -0,0 +1,23 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#ifndef STRICT +#define STRICT +#endif + +#include "targetver.h" + +#define _ATL_APARTMENT_THREADED +#define _ATL_NO_AUTOMATIC_NAMESPACE + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +#include "resource.h" +#include +#include +#include + +using namespace ATL; diff --git a/pwdmgr-win/win/service/targetver.h b/pwdmgr-win/win/service/targetver.h new file mode 100644 index 00000000000..27867ba249b --- /dev/null +++ b/pwdmgr-win/win/service/targetver.h @@ -0,0 +1,26 @@ + +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif + diff --git a/pwdmgr-win/win/setup/header_logo.JPG b/pwdmgr-win/win/setup/header_logo.JPG new file mode 100644 index 00000000000..05008b61cce Binary files /dev/null and b/pwdmgr-win/win/setup/header_logo.JPG differ diff --git a/pwdmgr-win/win/setup/setup.vdproj b/pwdmgr-win/win/setup/setup.vdproj new file mode 100644 index 00000000000..de3194ffd12 --- /dev/null +++ b/pwdmgr-win/win/setup/setup.vdproj @@ -0,0 +1,856 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:setup" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_421F387C3C8BE5A8FA70EAB78A715FD0" + "OwnerKey" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4F2493FEFBCA4539E21F5514BE9A3E3D" + "OwnerKey" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_ED21EE548BA9C60849ECACC981B5EA9E" + "OwnerKey" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:..\\bin\\Debug\\VMOpsInstanceManager.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:..\\bin\\Release\\VMOpsInstanceManager.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + } + "Deployable" + { + "CustomAction" + { + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_B14ADAD548D742CD88000A203740D9D4" + { + "Name" = "8:Primary Output from VMOps Instance Manager (Active)" + "Condition" = "8:" + "Object" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "FileType" = "3:2" + "InstallAction" = "3:1" + "Arguments" = "8:/Service" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_9003A5D7_BC92_49C4_8F1B_2B43EAB4A5D3" + "InstallerClass" = "11:FALSE" + "CustomActionData" = "8:" + } + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_F72BD84453EE4E7A84BC2FE586E82454" + { + "Name" = "8:Primary Output from VMOps Instance Manager (Active)" + "Condition" = "8:" + "Object" = "8:_3A5BDE922A5348F180B97034CE37C1BF" + "FileType" = "3:2" + "InstallAction" = "3:4" + "Arguments" = "8:/UnregServer" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_BED635F7_F779_4DCF_9D15_A6B084832831" + "InstallerClass" = "11:FALSE" + "CustomActionData" = "8:" + } + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + } + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_421F387C3C8BE5A8FA70EAB78A715FD0" + { + "SourcePath" = "8:WININET.dll" + "TargetName" = "8:WININET.dll" + "Tag" = "8:" + "Folder" = "8:_C239EFF6D5514C779D4C4F9566A171B8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4F2493FEFBCA4539E21F5514BE9A3E3D" + { + "SourcePath" = "8:NETAPI32.dll" + "TargetName" = "8:NETAPI32.dll" + "Tag" = "8:" + "Folder" = "8:_C239EFF6D5514C779D4C4F9566A171B8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D7F1DD58C60C46D1BDEB8499DC8150FA" + { + "SourcePath" = "8:header_logo.JPG" + "TargetName" = "8:header_logo.JPG" + "Tag" = "8:" + "Folder" = "8:_C239EFF6D5514C779D4C4F9566A171B8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:FALSE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ED21EE548BA9C60849ECACC981B5EA9E" + { + "SourcePath" = "8:IPHLPAPI.DLL" + "TargetName" = "8:IPHLPAPI.DLL" + "Tag" = "8:" + "Folder" = "8:_C239EFF6D5514C779D4C4F9566A171B8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_7F56AB2507E84461833EDE384F6E7F70" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_C239EFF6D5514C779D4C4F9566A171B8" + { + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_C90EDD7FDE3941EA91C39526154D99D5" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:VMOps VM Instance Manager" + "ProductCode" = "8:{CF1EDAC1-1EF6-495A-8211-8EECEE496060}" + "PackageCode" = "8:{DAFE57B9-3DAB-4A0D-92AF-3C77C3EE4208}" + "UpgradeCode" = "8:{24149E96-AFD7-4183-8507-7778FC637D39}" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:FALSE" + "DetectNewerInstalledVersion" = "11:FALSE" + "InstallAllUsers" = "11:TRUE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:VMOps, Inc." + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:Setup VMOps VM Instance Manager" + "Subject" = "8:" + "ARPCONTACT" = "8:VMOps, Inc." + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:http://www.vmops.com/" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_8975FC05ADD34A2C9C94A4946B6B9DC7" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_F965FA19BE9E47CBB56C35DA53243F90" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_757532B8569C41658C923D4E6880474B" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_22E674931CCB42B5B9D0860722E164AC" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_13AF80F70FA7450DBD841A3930D9DCF8" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_55E74A33BB7F4F16AE27ED3648472802" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2711BD9D13914FEF9228CFDEF845A022" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4E89AD5D95794FCFB5370B41D458765C" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_6D87C958A9524610A19F2A0996123D12" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_7B22E2DB76EB46F6B5FABAFDE7EE287B" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2CE21F052A5F4CF2B1474714042DB343" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F5D3FD2DE7EA423E891EDD2928B83871" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_597B01D8B0D24A20A6FB19FF3456BCAF" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_74DF525F83104968988C3845E2757E95" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_7AC32BD0776244C288C5775BB4C9EE01" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_9B11848351C44B188FFB7418A41FD034" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1FE221E045F04C21BF3078350AA9BED0" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_670742915D784306BCFD05B763D8BC15" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CB398615CFB146AE91B355ECB7E4FFF1" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_D577B05A75CD440184C222CB42F95A58" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_EFFC4D98DC5B4D89B44B6D96FF78936A" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_172D85EB7DDD45CEBC60093A285B85C9" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:2" + "Value" = "8:_D7F1DD58C60C46D1BDEB8499DC8150FA" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_3A5BDE922A5348F180B97034CE37C1BF" + { + "SourcePath" = "8:..\\bin\\release\\vmopsservice.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_C239EFF6D5514C779D4C4F9566A171B8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{212919B4-2196-44B8-B026-A351E4D8F19A}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +}