Usposobil sem nastavljanje sistemskih servisov med namestitvijo.

Uredil sem nomenklaturo akcij po meri.
This commit is contained in:
Simon Rozman 2014-03-20 18:18:43 +00:00
parent db0e2ff3b3
commit ed18da4ebb
5 changed files with 96 additions and 91 deletions

View File

@ -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]
<<NOKEEP
"De.$(PLAT).$(CFG).ActionText-2.idt" : "En.$(PLAT).$(CFG).ActionText-2.idtx" "..\L10N\de_DE.po"
@ -135,18 +135,18 @@ All :: "$(LANG).$(PLAT).$(CFG).CustomAction-1.idt"
Action Type Source Target
s$(MSIBUILD_LENGTH_ID) i2 S$(MSIBUILD_LENGTH_ID) S255
CustomAction Action
EvaluateCertificates 1 binMSICA.dll EvaluateCertificates
InstallCertificates 3073 binMSICA.dll ExecuteSequence
RollbackCertificates 3329 binMSICA.dll ExecuteSequence
CommitCertificates 3585 binMSICA.dll ExecuteSequence
EvaluateServiceConfiguration 1 binMSICA.dll EvaluateServiceConfiguration
ConfigureServices 3073 binMSICA.dll ExecuteSequence
RollbackServiceConfiguration 3329 binMSICA.dll ExecuteSequence
CommitServiceConfiguration 3585 binMSICA.dll ExecuteSequence
EvaluateScheduledTasks 1 binMSICA.dll EvaluateScheduledTasks
InstallScheduledTasks 3073 binMSICA.dll ExecuteSequence
RollbackScheduledTasks 3329 binMSICA.dll ExecuteSequence
CommitScheduledTasks 3585 binMSICA.dll ExecuteSequence
CertificatesEval 1 binMSICA.dll CertificatesEval
CertificatesExec 3073 binMSICA.dll ExecuteSequence
CertificatesRollback 3329 binMSICA.dll ExecuteSequence
CertificatesCommit 3585 binMSICA.dll ExecuteSequence
ServiceConfigEval 1 binMSICA.dll ServiceConfigEval
ServiceConfigExec 3073 binMSICA.dll ExecuteSequence
ServiceConfigRollback 3329 binMSICA.dll ExecuteSequence
ServiceConfigCommit 3585 binMSICA.dll ExecuteSequence
ScheduledTasksEval 1 binMSICA.dll ScheduledTasksEval
ScheduledTasksExec 3073 binMSICA.dll ExecuteSequence
ScheduledTasksRollback 3329 binMSICA.dll ExecuteSequence
ScheduledTasksCommit 3585 binMSICA.dll ExecuteSequence
<<NOKEEP
@ -161,18 +161,18 @@ All :: "$(LANG).$(PLAT).$(CFG).InstallExecuteSequence-1.idt"
Action Condition Sequence
s$(MSIBUILD_LENGTH_ID) S255 I2
InstallExecuteSequence Action
EvaluateCertificates 6577
RollbackCertificates 6576
InstallCertificates 6578
CommitCertificates 6579
EvaluateScheduledTasks 6580
RollbackScheduledTasks 6581
InstallScheduledTasks 6582
CommitScheduledTasks 6583
EvaluateServiceConfiguration 6584
RollbackServiceConfiguration 6585
ConfigureServices 6586
CommitServiceConfiguration 6587
CertificatesEval 6576
CertificatesRollback 6577
CertificatesExec 6578
CertificatesCommit 6579
ScheduledTasksEval 6580
ScheduledTasksRollback 6581
ScheduledTasksExec 6582
ScheduledTasksCommit 6583
ServiceConfigEval 6584
ServiceConfigRollback 6585
ServiceConfigExec 6586
ServiceConfigCommit 6587
<<NOKEEP

View File

@ -27,7 +27,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpRes
// Exported functions
////////////////////////////////////////////////////////////////////
UINT MSICA_API EvaluateCertificates(MSIHANDLE hInstall)
UINT MSICA_API CertificatesEval(MSIHANDLE hInstall)
{
//::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
@ -151,7 +151,7 @@ UINT MSICA_API EvaluateCertificates(MSIHANDLE hInstall)
if (uiResult == NO_ERROR) {
// Save the sequences.
uiResult = MSICA::SaveSequence(hInstall, _T("InstallCertificates"), _T("CommitCertificates"), _T("RollbackCertificates"), olExecute);
uiResult = MSICA::SaveSequence(hInstall, _T("CertificatesExec"), _T("CertificatesCommit"), _T("CertificatesRollback"), olExecute);
} else if (uiResult != ERROR_INSTALL_USEREXIT) {
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_OPLIST_CREATE);
::MsiRecordSetInteger(hRecordProg, 2, uiResult );
@ -178,9 +178,9 @@ UINT MSICA_API EvaluateCertificates(MSIHANDLE hInstall)
}
UINT MSICA_API EvaluateServiceConfiguration(MSIHANDLE hInstall)
UINT MSICA_API ServiceConfigEval(MSIHANDLE hInstall)
{
::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
//::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
UINT uiResult;
BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL));
@ -260,7 +260,7 @@ UINT MSICA_API EvaluateServiceConfiguration(MSIHANDLE hInstall)
if (uiResult == NO_ERROR) {
// Save the sequences.
uiResult = MSICA::SaveSequence(hInstall, _T("ConfigureServices"), _T("CommitServiceConfiguration"), _T("RollbackServiceConfiguration"), olExecute);
uiResult = MSICA::SaveSequence(hInstall, _T("ServiceConfigExec"), _T("ServiceConfigCommit"), _T("ServiceConfigRollback"), olExecute);
} else if (uiResult != ERROR_INSTALL_USEREXIT) {
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_OPLIST_CREATE);
::MsiRecordSetInteger(hRecordProg, 2, uiResult );
@ -287,7 +287,7 @@ UINT MSICA_API EvaluateServiceConfiguration(MSIHANDLE hInstall)
}
UINT MSICA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
UINT MSICA_API ScheduledTasksEval(MSIHANDLE hInstall)
{
//::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
@ -396,7 +396,7 @@ UINT MSICA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
if (uiResult == NO_ERROR) {
// Save the sequences.
uiResult = MSICA::SaveSequence(hInstall, _T("InstallScheduledTasks"), _T("CommitScheduledTasks"), _T("RollbackScheduledTasks"), olExecute);
uiResult = MSICA::SaveSequence(hInstall, _T("ScheduledTasksExec"), _T("ScheduledTasksCommit"), _T("ScheduledTasksRollback"), olExecute);
} else if (uiResult != ERROR_INSTALL_USEREXIT) {
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_OPLIST_CREATE);
::MsiRecordSetInteger(hRecordProg, 2, uiResult );
@ -425,7 +425,7 @@ UINT MSICA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
UINT MSICA_API ExecuteSequence(MSIHANDLE hInstall)
{
::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
//::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK);
return MSICA::ExecuteSequence(hInstall);
}

View File

@ -24,9 +24,9 @@
extern "C" {
#endif
UINT MSICA_API EvaluateCertificates(MSIHANDLE hInstall);
UINT MSICA_API EvaluateServiceConfiguration(MSIHANDLE hInstall);
UINT MSICA_API EvaluateScheduledTasks(MSIHANDLE hInstall);
UINT MSICA_API CertificatesEval(MSIHANDLE hInstall);
UINT MSICA_API ServiceConfigEval(MSIHANDLE hInstall);
UINT MSICA_API ScheduledTasksEval(MSIHANDLE hInstall);
UINT MSICA_API ExecuteSequence(MSIHANDLE hInstall);
#ifdef __cplusplus

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-03-14 11:11+0100\n"
"POT-Creation-Date: 2014-03-20 18:56+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\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 ""

View File

@ -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