We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

philb1208
Posts: 44
Joined: Thu Jul 04, 2019 3:24 pm

Use a variable from my installer in my update package.

Hello,


At the moment, during install the user specifies hostname of the server with the configuration files stored. It's stored in [CONFIG_LOCATION]. In the updater section of my installer i've created the link as: http ://[CONFIG_LOCATION]/update.txt

In my testing environment my server is just called "apache" so this is the value i provide. The above URL then becomes http: //apache/update.txt

This works perfectly for checking for new updates, the URL is constructed and the updater will go and check for any newer versions.

The server name could change depending on who and where the application is being installed. Is it possible to pass the [CONFIG_LOCATION] variable from the main installation package to the URL field in the update package, so the field for the URL to the executable would be http: //[CONFIG_LOCATION]/file.exe but this would be created as http: //apache/file.exe?

This would be really useful for me, I work for an MSP and we will be installing this across many sites/systems - I don't want to have to package a different updater for each site/client where i install my application.

The [CONFIG_LOCATION] itself is persistent and written into the registry.

Is this possible, or is there a possible way to work around this?

Edit: made the URLs non clickable.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a variable from my installer in my update package.

Hello Phil,

If by this, you mean you want to use the [CONFIG_LOCATION] property in the "Main URL" field from the "Updates Configuration Project", then I am afraid that this is not possible.

Please keep in mind that your main project and the Updates Configuration project are two different projects. Additionally, the updater is a standalone EXE.

This pretty much has nothing to do with the main setup here. Everything is done through the updater. The updater will go and check the link, will then download and consume the text file.

However, there still may be a way in which you can achieve this.

You can set the URL to your setup.exe file relatively to the updates configuration file (updates.txt file). This could be either a local path(eg. "file://c:\test\updates.txt" or a URL (eg. "http://example.com/updates.txt")

Please have a look on the following thread:

Re: AutoUpdater via network share - questions

for more information about this.

Additionally, please let me allow to explain this a bit:

Basically, what your need to do here is to have the setup in the same location as your updates configuration project (the setup is relative to the updates.txt file)

E.g.:

Updates configuration project path: http://example.com/updates.txt

==>

your setup path (the place from where the updater will download the setup): http://example.com/setup.exe

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
philb1208
Posts: 44
Joined: Thu Jul 04, 2019 3:24 pm

Re: Use a variable from my installer in my update package.

Hi Catalin,

Apologies for not responding. I've been out of the office.

In the end we opted to do the following:

1) we create the update file using the default http://example.com/ URL
2) Copy this over to my server
3) define a cron task to open the update file and edit the URL to use the servers FQDN.

It's still a theory at the moment, i need to try. Thanks for your suggestion though.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a variable from my installer in my update package.

Hello Phil,

Thank you for your followup on this and for sharing your solution with us.

Hopefully this will work as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”