skizdigidy
Posts: 10
Joined: Fri Mar 12, 2010 6:58 pm

Dynamic Update URL

I have an application that I need to dynamically populate the "Update URL" field based on a user's location. We have 3 facilities throughout my company: Minnesota, Arizona, and Virginia. All 3 facilities will be using this application, and I will be posting Installs/Updates on their respective file servers when needed.

My Question:
On the Updates URL of the Updater section of a Professional Project, is there a way for me to make that URL somehow dynamic to account for the 3 different facilities' file server URL's? For example the server path in the MN facility could be file://\\mn\installs\program\update.txt, but at the AZ facility the server path could be file://\\az\installs\program\update.txt. Is there some way to perhaps read the registry and write that update config file from some information in the registry? Does that make sense?

Thanks again for all your help!

Scott
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Dynamic Update URL

Hi Scott,

This is easy. On the updates page, use a property for the Updates URL field. Then set that property depending on what the user selects during install.

Since you do not own an enterprise license, your UI for selecting the location will be limited to messageboxes. In an enterprise project you could create a new dialog in which the user can select his location.

Attached is an example demonstrating this behavior.

Note the following settings:
- The Updates URL field on the Updater page
- the custom actions under "Begin" standard action.

Best regards,
Gabriel
Attachments
example.aip
(11.61 KiB) Downloaded 364 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
skizdigidy
Posts: 10
Joined: Fri Mar 12, 2010 6:58 pm

Re: Dynamic Update URL

Gabriel,

Thanks again for the help. Is it possible to create a custom action that reads a registry value and then populates that URL field depending on what value is in the registry, instead of using message boxes? While the example you gave me completely works, I really want to eliminate as much user interaction as possible, and if I could do it silently, all the better. Would that be possible? I know of a registry entry that I can use to differentiate the 3 facilities.

Thanks,
Scott
skizdigidy
Posts: 10
Joined: Fri Mar 12, 2010 6:58 pm

Re: Dynamic Update URL

Here is an idea...Can't I create a dll with a method in it that returns me the correct file path? And then call that method from within a custom action?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Dynamic Update URL

Hello,

Yes, you can create a DLL and return the selection by using the MsiSetProperty API to set a property from within the DLL. Note that for a custom action to be able to set a property, the custom needs to be run as Immediate, otherwise it will fail.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”