codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Updater URL based on installed component

We previously used a different updater and would like to switch to the AI Updater. Our msi has multiple components that contain config files depending on what region the user installs (alpha, beta, production). The update url is different for each region. Is there a way to setup the urls for the component being installed or do I need to write a vbs to edit the property after the msi is built?

Can I manually create an ini file for each of my regions and create a component for each to be installed with the right component or will the updater ini overwrite mine?

Thanks,
Scott
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello Scott,

In order to achieve this you can use an installer property in the "Updates Configuration File URL" field which will be resolved at install time based on a specific condition. Here are the steps to proceed:
- Go to "Updater" page and set the "Updates Configuration File URL" field like this:

Code: Select all

[MY_PROP]
- Go to "Custom Actions" page and add "Set installer property" custom actions with sequence, scheduled after "Install Execution Stage -> Paths Resolution" action group, like this: - Build and run your project.

Also, you can take a look on "Language Identifier Constants and Strings" article which should be useful for you.

Another approach would be to integrate the updater within your application and call him with the -url command line parameter from your application.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Updater URL based on installed component

Thanks, sending the url seems to be the best way for us to do it.

When I add the updater.exe to my project it creates the ini file. I also need that ini file on my server for the updater to check. Is there a way to get the installer to copy that ini file so I can use it for my deployment website? I use a seperate advanced installer project for the deployment websites. Is it better to build the deployment site from the same aip as my client msi?

First time using AI updater and trying to figure out how exactly it works.

thanks,
Scott
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello Scott,

I'm afraid I don't fully understand what you want to achieve. Can you give us more details about your scenario (maybe exemplify)? If you want to implement the Updater functionality in another project, then you can enable the Updater tool from our "Updater" page. In this way a specific .ini file will be generated and added, alongside the updater.exe file, in your project (in Application Folder from "Files and Folders" page).

Also, for a better understanding of how our Updater tool works you can take a look on our "Using The Updater" tutorial.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Updater URL based on installed component

I found my answer. I have to create an update aip that imports my msi. Although I still need to create a project to deploy the config file and msi to a website. So it seems I need to aip files just to create the update website.

I need to deploy this to all 3 of our regions (alpha, beta, prod). Is there an easy way to dynamically change the url of the ini file when I install the deployment site?

I have written code in our application to work with the updater. I'm trying to decide how to manage the update. I'd like to use the updater UI, but I need to be able to disable the cancel and pause buttons, since when we have an update we force our users to update otherwise they will be out of since with our DB. Is there a config setting to do this?

If that's not possible, I will use the /justcheck to see if there is an update. If there is an update, which call do I use to the updater that will download the new one, close my current application and run the update with at least a progress bar, so the user knows the update is being performed. The updater UI would be perfect, if I can disable the cancel and pause buttons and force the update.

I've been looking over the updater pages and can not seem to find this.

Thanks,
Scott
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello Scott,
I found my answer. I have to create an update aip that imports my msi. Although I still need to create a project to deploy the config file and msi to a website. So it seems I need to aip files just to create the update website.

I need to deploy this to all 3 of our regions (alpha, beta, prod). Is there an easy way to dynamically change the url of the ini file when I install the deployment site?
In order to achieve this you can add the related alpha, beta versions of your product in the "Updates Targets" tab in your updates configuration project. In this way you will be able to use one update configuration file for more applications targets.
I have written code in our application to work with the updater. I'm trying to decide how to manage the update. I'd like to use the updater UI, but I need to be able to disable the cancel and pause buttons, since when we have an update we force our users to update otherwise they will be out of since with our DB. Is there a config setting to do this?
I'm afraid we don't have support for this.
If that's not possible, I will use the /justcheck to see if there is an update. If there is an update, which call do I use to the updater that will download the new one, close my current application and run the update with at least a progress bar, so the user knows the update is being performed. The updater UI would be perfect, if I can disable the cancel and pause buttons and force the update.
You can call the updater using a command line like this:

Code: Select all

updater.exe /silentall -nofreqcheck
Also, you can add your application (which need to be closed during upgrade) in the "Auto Close Applications" tab from your updates configuration project. If you want to run the upgraded installation package with basic UI, then you can use a command line like this:

Code: Select all

/qb
in the "Command Line" field from "Properties" tab.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Updater URL based on installed component

Thanks again for the help.

I see that there's a -justdownload, but I don't see a -justinstall or anything that'll kick off the install. I'd like to download it in the background and run the install when the user is ready, so they are saved the download time. If I run updater.exe /silentall -nofreqcheck will it check the download folder first and if it exists run the install from there?


Also, I have a radio button page that installs the site name for Alpha, Beta or Prod. Is there a way to setup the ports for each of these depending on the radio button? The current install we call from a batch file because it sets 6 variables when it calls the msi. I'd like to get away from setting all those things through a batch file. Is there a way to create a component that would set those 6 properties based on my radio button (the radio button property)? Or is there another way to set a bunch of properties based on another property.

ex: radio button sets INSTALLREGION="Alpha" so i'd like my properties to be my alpha versions

httpport = "888"
httpsport = "999"
siteurl = "http://myalphasite.com"
sitehttpsurl = "https://myalphasite.com"

but if the radio button is set to "Beta" i need those variables to be say:

httpport = "8881"
httpsport = "9991"
siteurl = "http://mybetasite.com"
sitehttpsurl = "https://mybetasite.com"

Thanks,
Scott
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello Scott,
I see that there's a -justdownload, but I don't see a -justinstall or anything that'll kick off the install. I'd like to download it in the background and run the install when the user is ready, so they are saved the download time. If I run updater.exe /silentall -nofreqcheck will it check the download folder first and if it exists run the install from there?
For this you can run the updater (to download updates if exists) using a command line like this:

Code: Select all

updater.exe /silentall -justdownload 
Later, you can install the updates using the "updater.exe /silentall -nofreqcheck" command line.
Also, I have a radio button page that installs the site name for Alpha, Beta or Prod. Is there a way to setup the ports for each of these depending on the radio button? The current install we call from a batch file because it sets 6 variables when it calls the msi. I'd like to get away from setting all those things through a batch file. Is there a way to create a component that would set those 6 properties based on my radio button (the radio button property)? Or is there another way to set a bunch of properties based on another property.

ex: radio button sets INSTALLREGION="Alpha" so i'd like my properties to be my alpha versions

httpport = "888"
httpsport = "999"
siteurl = "http://myalphasite.com"
sitehttpsurl = "https://myalphasite.com"

but if the radio button is set to "Beta" i need those variables to be say:

httpport = "8881"
httpsport = "9991"
siteurl = "http://mybetasite.com"
sitehttpsurl = "https://mybetasite.com"
In order to achieve this you can proceed like this:
- Go to "Dialogs" page and add a custom feature selection dialog containing a radio button group with two radio button controls.
- Select the radio button group and set the "Property Name" field, from "Properties" right pane, to RADIO_PROP.
- Select the first radio button and set the "Value" field, from "Properties" right pane, to alpha and "Text" field to Alpha.
- Select the second radio button and set the "Value" field, from "Properties" right pane, to beta and "Text" field to Beta.
- On the [Next>] button and add "Set installer property value" published events like this:
  • Event: [httpport]
    Argument: 888
    Condition: RADIO_PROP = "alpha"

    Event: [httpport]
    Argument: 8881
    Condition: RADIO_PROP = "beta"

    Event: [siteurl]
    Argument: http://myalphasite.com
    Condition: RADIO_PROP = "alpha"

    Event: [siteurl]
    Argument: http://mybetasite.com
    Condition: RADIO_PROP = "beta"
- Build and run your project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Updater URL based on installed component

That should work great, thanks. I have a condition on my radio button dialog that it only shows if the value is not set. The radio buttons are so developers and QA and change the regions if they need to, but for clients we preset the value so the dialog doesn't show. Will the published events still process if the dialog is not shown?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello,

No, I'm afraid that if the dialog isn't displayed, then the related published events will not be triggered. However, in this case you can add similar "Set installer property" custom actions with sequence, scheduled after "Install Execution Stage -> Searches" action group in "Custom Actions" page.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Re: Updater URL based on installed component

Thanks. I've seen that custom action, but it can only set 1 property at a time. I'll end up with a bunch of custom actions just to set everything, since there doesn't seem to be a custom action that can set multiple properties.

One property I set is based off which radio button is selected. The property is then used as part of the folder path, could this be set as an Init Event when the FolderDlg loads? 99.9% of the time the radio button dialog will not show b/c the value will be preset before the installer runs.

Thanks for all the help.
Scott
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Updater URL based on installed component

Hello Scott,
One property I set is based off which radio button is selected. The property is then used as part of the folder path, could this be set as an Init Event when the FolderDlg loads? 99.9% of the time the radio button dialog will not show b/c the value will be preset before the installer runs.
Yes, you can use "Set installer property value" init events added on "FolderDlg" dialog in order to obtain what you want.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”