BenoitAndrieu
Posts: 2
Joined: Mon Jun 09, 2014 2:21 pm
Location: Grenoble, France
Contact: Website

Make "install support service" for updates optional ?

Hi,

We are currently evaluating Advanced Installer because we want to achieve auto-updates.

One of our needs is to allow installation of updates on machines where users do not have elevated rights. So, ok, there is the "install support service" in "update behavior".

But we also want to make sure that the administrative guy can at the first-time install disallow or allow his fellows to make thoses changes to these machines.

I actually managed to add a dialog with two Yes/No checkboxes which will install or not the updater.exe and the service.

But, this is not what I want because by clicking No this will totally remove the ability to update...

What I really would like is to (install / enable) or (not install / disable) the "support service" depending on the choice of the user on the first-time install.

Is this possible ?

Thanks in advance
Last edited by BenoitAndrieu on Mon Jun 16, 2014 8:45 am, edited 1 time in total.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Make "install support service" for updates optionnal ?

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.
sample.zip
(1.22 MiB) Downloaded 544 times
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
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BenoitAndrieu
Posts: 2
Joined: Mon Jun 09, 2014 2:21 pm
Location: Grenoble, France
Contact: Website

Re: Make "install support service" for updates optionnal ?

Thank you for this detailed answer !
Daniel wrote:I apologize for my delayed answer.
No problem, you're a lot faster than Flexera.......
Daniel wrote: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:
...

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

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.
I had imagined the two possibilities but couldn't find an "easy/fast" way to try it and thought it was the perfect occasion to try the forum ! :)
The first solution seems indeed cleaner than the "workaround".
Daniel wrote:Unfortunately, we don't have predefined support for this.
Wouldn't this be interesting ? ;)

Thanks again
Best regards
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Make "install support service" for updates optionnal ?

You're welcome. Maybe will consider your suggestion to add predefined support, for having the option to select/unselect the updater service installation at install time, in a future version of Advanced Installer. Thank you for your suggestion.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
senthilkumar
Posts: 7
Joined: Mon Jan 30, 2017 11:08 am

Re: Make "install support service" for updates optionnal ?

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.
This is not working with the latest version (13.5). Please help me.
senthilkumar
Posts: 7
Joined: Mon Jan 30, 2017 11:08 am

Re: Make "install support service" for updates optional ?

Where/How can I see the logs generated by updater.exe?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Make "install support service" for updates optional ?

Hello and welcome to our forums,

I've tested the old attached sample and indeed when the Updater.exe is installed in a path containing spaces the updates installation fails. This happens because when the Updater service is configured the path to the Updater.exe should be enclosed between quotes.

Please find attached a fixed version of the previous sample, created with the AI 13.5 version.
sample.zip
(9.63 KiB) Downloaded 455 times
Let us know how this works.
Where/How can I see the logs generated by updater.exe?
Unfortunately the Updater doesn't have support to create logs. This improvement is already on our todo list and as soon as it will be available we will update this thread.

Until then, as a workaround you can check the Updater exit codes.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
senthilkumar
Posts: 7
Joined: Mon Jan 30, 2017 11:08 am

Re: Make "install support service" for updates optional ?

It work's fine now. Thanks!

In our case, we have both per-user and per-machine options. We want the updater service to be installed only for per-machine scenario. We don't want to add one more dialog where the user will choose whether he wants to install the updates without admin privileges as given in the sample application (CHECKBOX_YES and CHECKBOX_NO).

Could you please let me know what kind of changes would be required?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Make "install support service" for updates optional ?

You're welcome.

To achieve what you want you should just delete the related dialog and the "CHECKBOX_YES" search. Then in the "Condition" field of the custom action added in "Custom Actions" page you should replace the "CHECKBOX_YES" property with the following statement:

Code: Select all

(INSTALL_TYPE_PROP = "per-machine")
The "INSTALL_TYPE_PROP" is a persistent property, defined in "Install Parameters" page, which is set to a per-user or to per-machine value on the [Next] button from "InstallTypeDlg" dialog depending on the user choice.

Please find attached a sample project with the above settings.
sample1.aip
(22.05 KiB) Downloaded 597 times
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
senthilkumar
Posts: 7
Joined: Mon Jan 30, 2017 11:08 am

Re: Make "install support service" for updates optional ?

Thanks, Dan.

One more query:

We have a scenario where updates.txt and setup.msi files will be downloaded only through REST API calls.

For example, we will make REST calls to download the files as given below

https://server.com/files/manifest/1001
https://server.com/files/setup/2001

When I tried my local web server, files were downloaded and installed successfully with "-url" switch. (No REST; regular HTTP call).
But, files are not getting downloaded when making REST API calls.

I suspect that when I make HTTP call, I explicitly set the file name in the URL and the same is not required in case of REST.

Could you please clarify?

Thanks,
Senthil
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Make "install support service" for updates optional ?

Hello Senthil,

Yes, you should make sure that the URLs used to call the Updater with are direct download links. If the used URLs are not direct download links the Updater won't download the hosted update files.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Make "install support service" for updates optional ?

Hello,

The support for the Updater to create log with its actions has been added in version 14.2 of Advanced Installer released on July 26th, 2017.

For details, please check the new set loglevel <attributes> command line option from the Auto Updater article.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”