I've recently tried to add a step in the upgrade process that manually backs up parts of the application folder, suffixing it with the previous version numbers.
No matter what I do or where I place the "Copy Folder" custom action (which was obviously before Remove Resources step), before InstallValidate or after it, I get the "Files in Use" dialog and a prompt to stop the running services. If I refuse to close the applications, the app prompts me to restart the computer after the installation.
Which has never been the case without this copy files action.
I've rewritten the custom action from PowerShell to VBScript, copied the files outside the application folder, placed the action before or after InstallValidate, or even as a client action on pressing the Next > button before VerifyReadyDialog.
It's all the same - files in use by the services, so close them, or I'll reboot the computer.
The services are certainly stopped during the installation to get them updated properly, and this step hasn't gone anywhere. It's also a PowerShell Custom action that does
Code: Select all
$instanceName = AI_GetMsiProperty INSTANCE_NAME
Get-Service svc1_$instanceName | % {Stop-Service $_}
Get-Service svc2_$instanceName | % {Stop-Service $_}
However, if I place two Stop Service actions in the Install Execution Stage, only the first of them gets executed. If I reorder them then the other service gets stopped and the first one keeps running by the InstallValidate stage.
The code is simple:
Code: Select all
DetectService1 / Service name: svc1_[INSTANCE_NAME]
StopService / Service name: svc1_[INSTANCE_NAME] / Condition AI_SERVICE_STATE = "Started"
DetectService2 / Service name: svc2_[INSTANCE_NAME]
StopService / Service name: svc2_[INSTANCE_NAME] / Condition AI_SERVICE_STATE = "Started"
I even tried saving the AI_SERVICE_STATE into another property, but no dice.
And the log shows it:
Code: Select all
MSI (s) (78:04) [19:08:30:155]: Doing action: DetectService1
Action start 19:08:30: DetectService1.
MSI (s) (78:78) [19:08:30:157]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI6260.tmp, Entrypoint: DetectService
MSI (s) (78!D0) [19:08:30:161]: PROPERTY CHANGE: Adding AI_SERVICE_STATE property. Its value is 'Stopped'.
MSI (s) (78!D0) [19:08:30:161]: PROPERTY CHANGE: Modifying AI_SERVICE_STATE property. Its current value is 'Stopped'. Its new value: 'Started'.
Action ended 19:08:30: DetectService1. Return value 1.
MSI (s) (78:04) [19:08:30:163]: Doing action: RememberSvc1State
Action start 19:08:30: RememberSvc1State.
MSI (s) (78:04) [19:08:30:164]: PROPERTY CHANGE: Adding AI_SERVICE_STATE_1 property. Its value is 'Started'.
Action ended 19:08:30: RememberSvc1State. Return value 1.
MSI (s) (78:04) [19:08:30:164]: Doing action: AI_DATA_SETTER_27
Action start 19:08:30: AI_DATA_SETTER_27.
MSI (s) (78:04) [19:08:30:164]: PROPERTY CHANGE: Modifying CustomActionData property. Its current value is 'svc1_MyInstance'. Its new value: 'svc2_MyInstance'.
Action ended 19:08:30: AI_DATA_SETTER_27. Return value 1.
MSI (s) (78:04) [19:08:30:164]: Doing action: AI_DATA_SETTER_39
Action start 19:08:30: AI_DATA_SETTER_39.
MSI (s) (78:04) [19:08:30:165]: PROPERTY CHANGE: Modifying CustomActionData property. Its current value is 'svc2_MyInstance'. Its new value: 'svc1_MyInstance'.
Action ended 19:08:30: AI_DATA_SETTER_39. Return value 1.
MSI (s) (78:04) [19:08:30:165]: Doing action: StopService1
Action start 19:08:30: StopService1.
MSI (s) (78:E0) [19:08:30:166]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI6261.tmp, Entrypoint: StopWinService
Action ended 19:08:30: StopService1. Return value 1.
MSI (s) (78:04) [19:08:30:696]: Doing action: DetectService2
Action start 19:08:30: DetectService2.
MSI (s) (78:F0) [19:08:30:698]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI6476.tmp, Entrypoint: DetectService
MSI (s) (78!7C) [19:08:30:701]: PROPERTY CHANGE: Modifying AI_SERVICE_STATE property. Its current value is 'Started'. Its new value: 'Stopped'.
Action ended 19:08:30: DetectService2. Return value 1.
MSI (s) (78:04) [19:08:30:703]: Doing action: RememberSvc2State
Action start 19:08:30: RememberSvc2State.
MSI (s) (78:04) [19:08:30:703]: PROPERTY CHANGE: Adding AI_SERVICE_STATE_2 property. Its value is 'Stopped'.
Action ended 19:08:30: RememberSvc2State. Return value 1.
MSI (s) (78:04) [19:08:30:703]: Skipping action: AI_DATA_SETTER_37 (condition is false)
MSI (s) (78:04) [19:08:30:703]: Skipping action: StopService2 (condition is false)
MSI (s) (78:04) [19:08:30:703]: Skipping action: AI_DOWNGRADE (condition is false)
Ple-a-se help.