diff --git a/MSICA/MSIBuild/Makefile b/MSICA/MSIBuild/Makefile index b904e8d..8bbaaca 100644 --- a/MSICA/MSIBuild/Makefile +++ b/MSICA/MSIBuild/Makefile @@ -72,9 +72,9 @@ All :: "$(LANG).$(PLAT).$(CFG).ActionText-2.idt" Action Description Template s$(MSIBUILD_LENGTH_ID) L0 L0 1252 ActionText Action -InstallCertificates Installing certificates Certificate: [1] -ConfigureServices Configuring services Service: [1] -InstallScheduledTasks Registering scheduled tasks Scheduled task: [1] +CertificatesExec Installing certificates Certificate: [1] +ServiceConfigExec Configuring services Service: [1] +ScheduledTasksExec Registering scheduled tasks Scheduled task: [1] <\n" "Language-Team: Amebis, d. o. o., Kamnik \n" @@ -17,15 +17,11 @@ msgstr "" "X-Poedit-SearchPath-0: MSIBuild\n" # Windows charset for this language (decimal) -#: MSIBuild/En.Win32.Debug.Error-2.idtx:3 -#: MSIBuild/En.Win32.Release.Error-2.idtx:3 -#: MSIBuild/En.x64.Debug.Error-2.idtx:3 MSIBuild/En.x64.Release.Error-2.idtx:3 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:3 MSIBuild/En.x64.Debug.Error-2.idtx:3 msgid "1252" msgstr "1250" -#: MSIBuild/En.Win32.Debug.Error-2.idtx:5 -#: MSIBuild/En.Win32.Release.Error-2.idtx:5 -#: MSIBuild/En.x64.Debug.Error-2.idtx:5 MSIBuild/En.x64.Release.Error-2.idtx:5 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:5 MSIBuild/En.x64.Debug.Error-2.idtx:5 msgid "" "Error [2] creating scheduled task list. Please, contact your support " "personnel." @@ -33,10 +29,17 @@ msgstr "" "Pri pripravi seznama razvrščenih opravil je prišlo do napake [2]. Obrnite se " "na svojo tehnično službo." +#: MSIBuild/En.Win32.Debug.Error-2.idtx:17 +#: MSIBuild/En.x64.Debug.Error-2.idtx:17 +msgid "" +"Error [3] changing service \"[2]\" start type. Please, contact your support " +"personnel." +msgstr "" +"Pri nastavljanju servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo " +"tehnično službo." + #: MSIBuild/En.Win32.Debug.Error-2.idtx:11 -#: MSIBuild/En.Win32.Release.Error-2.idtx:11 #: MSIBuild/En.x64.Debug.Error-2.idtx:11 -#: MSIBuild/En.x64.Release.Error-2.idtx:11 msgid "" "Error [3] creating \"[2]\" scheduled task. Please, contact your support " "personnel." @@ -44,9 +47,7 @@ msgstr "" "Pri stvaritvi razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite " "se na svojo tehnično službo." -#: MSIBuild/En.Win32.Debug.Error-2.idtx:9 -#: MSIBuild/En.Win32.Release.Error-2.idtx:9 -#: MSIBuild/En.x64.Debug.Error-2.idtx:9 MSIBuild/En.x64.Release.Error-2.idtx:9 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:9 MSIBuild/En.x64.Debug.Error-2.idtx:9 msgid "" "Error [3] deleting \"[2]\" file. Please, contact your support personnel." msgstr "" @@ -54,9 +55,7 @@ msgstr "" "tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:12 -#: MSIBuild/En.Win32.Release.Error-2.idtx:12 #: MSIBuild/En.x64.Debug.Error-2.idtx:12 -#: MSIBuild/En.x64.Release.Error-2.idtx:12 msgid "" "Error [3] deleting \"[2]\" scheduled task. Please, contact your support " "personnel." @@ -65,9 +64,7 @@ msgstr "" "se na svojo tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:13 -#: MSIBuild/En.Win32.Release.Error-2.idtx:13 #: MSIBuild/En.x64.Debug.Error-2.idtx:13 -#: MSIBuild/En.x64.Release.Error-2.idtx:13 msgid "" "Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your " "support personnel." @@ -76,9 +73,7 @@ msgstr "" "Obrnite se na svojo tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:15 -#: MSIBuild/En.Win32.Release.Error-2.idtx:15 #: MSIBuild/En.x64.Debug.Error-2.idtx:15 -#: MSIBuild/En.x64.Release.Error-2.idtx:15 msgid "" "Error [3] installing certificate to certificate store \"[2]\". Please, " "contact your support personnel." @@ -86,9 +81,7 @@ msgstr "" "Pri nameščanju digitalnega potrdila v shrambo »[2]« je prišlo do napake [3]. " "Obrnite se na svojo tehnično službo." -#: MSIBuild/En.Win32.Debug.Error-2.idtx:7 -#: MSIBuild/En.Win32.Release.Error-2.idtx:7 -#: MSIBuild/En.x64.Debug.Error-2.idtx:7 MSIBuild/En.x64.Release.Error-2.idtx:7 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:7 MSIBuild/En.x64.Debug.Error-2.idtx:7 msgid "" "Error [3] reading from \"[2]\" task list file. Please, contact your support " "personnel." @@ -97,9 +90,7 @@ msgstr "" "Obrnite se na svojo tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:16 -#: MSIBuild/En.Win32.Release.Error-2.idtx:16 #: MSIBuild/En.x64.Debug.Error-2.idtx:16 -#: MSIBuild/En.x64.Release.Error-2.idtx:16 msgid "" "Error [3] removing certificate from certificate store \"[2]\". Please, " "contact your support personnel." @@ -107,18 +98,30 @@ msgstr "" "Pri odstranjevanju digitalnega potrdila iz shrambe »[2]« je prišlo do napake " "[3]. Obrnite se na svojo tehnično službo." -#: MSIBuild/En.Win32.Debug.Error-2.idtx:8 -#: MSIBuild/En.Win32.Release.Error-2.idtx:8 -#: MSIBuild/En.x64.Debug.Error-2.idtx:8 MSIBuild/En.x64.Release.Error-2.idtx:8 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:8 MSIBuild/En.x64.Debug.Error-2.idtx:8 msgid "" "Error [3] setting \"[2]\" parameter. Please, contact your support personnel." msgstr "" "Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na " "svojo tehnično službo." -#: MSIBuild/En.Win32.Debug.Error-2.idtx:6 -#: MSIBuild/En.Win32.Release.Error-2.idtx:6 -#: MSIBuild/En.x64.Debug.Error-2.idtx:6 MSIBuild/En.x64.Release.Error-2.idtx:6 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:18 +#: MSIBuild/En.x64.Debug.Error-2.idtx:18 +msgid "" +"Error [3] starting service \"[2]\". Please, contact your support personnel." +msgstr "" +"Pri zagonu servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo " +"tehnično službo." + +#: MSIBuild/En.Win32.Debug.Error-2.idtx:19 +#: MSIBuild/En.x64.Debug.Error-2.idtx:19 +msgid "" +"Error [3] stopping service \"[2]\". Please, contact your support personnel." +msgstr "" +"Pri zaustavitvi servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo " +"tehnično službo." + +#: MSIBuild/En.Win32.Debug.Error-2.idtx:6 MSIBuild/En.x64.Debug.Error-2.idtx:6 msgid "" "Error [3] writing to \"[2]\" task list file. Please, contact your support " "personnel." @@ -127,9 +130,7 @@ msgstr "" "Obrnite se na svojo tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:14 -#: MSIBuild/En.Win32.Release.Error-2.idtx:14 #: MSIBuild/En.x64.Debug.Error-2.idtx:14 -#: MSIBuild/En.x64.Release.Error-2.idtx:14 msgid "" "Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your " "support personnel." @@ -138,9 +139,7 @@ msgstr "" "Obrnite se na svojo tehnično službo." #: MSIBuild/En.Win32.Debug.Error-2.idtx:10 -#: MSIBuild/En.Win32.Release.Error-2.idtx:10 #: MSIBuild/En.x64.Debug.Error-2.idtx:10 -#: MSIBuild/En.x64.Release.Error-2.idtx:10 msgid "" "Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support " "personnel." @@ -148,9 +147,7 @@ msgstr "" "Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4]. Obrnite se na " "svojo tehnično službo." -#: MSIBuild/En.Win32.Debug.Error-2.idtx:4 -#: MSIBuild/En.Win32.Release.Error-2.idtx:4 -#: MSIBuild/En.x64.Debug.Error-2.idtx:4 MSIBuild/En.x64.Release.Error-2.idtx:4 +#: MSIBuild/En.Win32.Debug.Error-2.idtx:4 MSIBuild/En.x64.Debug.Error-2.idtx:4 msgid "" "Error opening installation package. Please, contact your support personnel." msgstr "" diff --git a/MSICALib/OpSvc.cpp b/MSICALib/OpSvc.cpp index d0a04de..ef4bf06 100644 --- a/MSICALib/OpSvc.cpp +++ b/MSICALib/OpSvc.cpp @@ -29,27 +29,35 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession) // Open the specified service. hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG); if (hService) { - QUERY_SERVICE_CONFIG sc; + QUERY_SERVICE_CONFIG *sc; DWORD dwSize; + HANDLE hHeap = ::GetProcessHeap(); - // Query current service config. - if (::QueryServiceConfig(hService, &sc, sizeof(sc), &dwSize)) { - if (sc.dwStartType != m_dwStartType) { - // Set requested service start. - if (::ChangeServiceConfig(hService, SERVICE_NO_CHANGE, m_dwStartType, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL)) { - if (pSession->m_bRollbackEnabled) { - // Order rollback action to revert the service start change. - pSession->m_olRollback.AddHead(new COpSvcSetStart(m_sValue, sc.dwStartType)); - } + ::QueryServiceConfig(hService, NULL, 0, &dwSize); + sc = (QUERY_SERVICE_CONFIG*)::HeapAlloc(hHeap, 0, dwSize); + if (sc) { + // Query current service config. + if (::QueryServiceConfig(hService, sc, dwSize, &dwSize)) { + if (sc->dwStartType != m_dwStartType) { + // Set requested service start. + if (::ChangeServiceConfig(hService, SERVICE_NO_CHANGE, m_dwStartType, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL)) { + if (pSession->m_bRollbackEnabled) { + // Order rollback action to revert the service start change. + pSession->m_olRollback.AddHead(new COpSvcSetStart(m_sValue, sc->dwStartType)); + } + dwError = NO_ERROR; + } else + dwError = ::GetLastError(); + } else { + // Service is already configured to start the requested way. dwError = NO_ERROR; - } else - dwError = ::GetLastError(); - } else { - // Service is already configured to start the requested way. - dwError = NO_ERROR; - } + } + } else + dwError = ::GetLastError(); + + ::HeapFree(hHeap, 0, sc); } else - dwError = ::GetLastError(); + dwError = ERROR_OUTOFMEMORY; } else dwError = ::GetLastError(); } else