Hello and welcome to Advanced Installer forums,
Thank you for your interest in Advanced Installer.
I apologize for my delayed answer.
Unfortunately, we don't have predefined support for this. However, as a workaround you can disable the "Install support service" option from "Updater" page and manually install and configure the updater service based on condition. Here are the steps to proceed:
- go to "Updater" page and disable the "Install support service" option
- go to "Dialogs" page and add a checkbox (CHECKBOX_YES) which will condition the updater service installation
- go to "Registry" page and create a registry value (i.e. UpdaterService) and then condition its component from "Organization" page to be installed only when the CHECKBOX_YES property is set (the check box is checked)
- go to "Search" page and add an extended search (i.e. CHECKBOX_YES) which will check if the "UpdaterService" registry value exists
- go to "Custom Actions" page and add a "Launch File" custom action with sequence (i.e. CreateUpdaterService) like this:
- File To Launch: sc.exe
Command Line: Create updater DisplayName= updater binPath= "[APPDIR]\updater.exe /runservice" type= own start= demand
Condition: (( ( ( NOT Installed AND VersionNT) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" AND VersionNT) ) AND ($updater.exe = 3) ) AND CHECKBOX_YES)
- add another "Launch File" custom action with sequence (i.e. ConfigureUpdaterService) like this:
- File To Launch: [#updater.exe]
Command Line: /configservice -name "updater"
Condition: (( ( ( NOT Installed AND VersionNT) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" AND VersionNT) ) AND ($updater.exe = 3) ) AND CHECKBOX_YES)
- the above custom actions will run only on install and should be scheduled as deferred with no impersonation after "Install Execution Stage -> Add Resources" actions group
- add another "Launch File" custom action with sequence (i.e. DeleteUpdaterService) scheduled on uninstall like this:
- File To Launch: sc.exe
Command Line: Delete updater
Condition: CHECKBOX_YES
- go to "Table Editor" page select the "IniFile" table and add a new row like this:
- IniFile: SupportServiceName
FileName: updater.ini
DirProperty: APPDIR
Section: General
Key: SupportServiceName
Value: updater
Action: 0
Component_: updater.exe
- build and run your project
I've attached a sample created with version 11.2.1 of Advanced Installer which implements a similar behavior.
Also, as another workaround you can enable the "Install support service" option from "Updater" page and then, only try to condition our "AI_UPDATER_SERVICE_CONFIG" custom action (this action configures the updater service during installation). Here are the steps to proceed:
- go to "Updater" page and enable "Install support service" option
- go to "Table Editor" page and select the "InstallExecuteSequence" table
- edit the condition row of the "AI_UPDATER_SERVICE_CONFIG" action like this:
Code: Select all
(( ( ( NOT Installed AND VersionNT) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" AND VersionNT) ) AND ($updater.exe = 3) ) AND CHECKBOX_YES)
- build and run your projects
Please note the latter workaround is not a recommended one (even is more straight forward) and should be tested against all your installation scenarios to make sure it works for you.
All the best,
Daniel
FOLLOW US
Get the latest news in Application Packaging