mtomsak
Posts: 11
Joined: Fri Mar 25, 2016 10:32 pm

Updater install of downloaded update without internet connectivity

If I have run the updater with the command line arguments "/silentall -nofreqcheck -justdownload", the updater will check for a newer version and download it.

Once I have done that, I would like the updater to install the update that has already been downloaded, but I would like it to work even if there is no internet connection.

Is there a way to do this? The documentation associated with the -justdownload switch says "To install the downloaded updates, call the updater again with any of the /checknow, /silent, /silentall or /silentcritical command line options." But these command line options require internet connectivity.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Updater install of downloaded update without internet connectivity

Hello,

This scenario is not officially supported. Have you tried to see if this works?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtomsak
Posts: 11
Joined: Fri Mar 25, 2016 10:32 pm

Re: Updater install of downloaded update without internet connectivity

Yes, I have tried this, and it works rather well.

Since I am assuming that I will not be able to install using the updater without an internet connection, I was thinking of programmatically launching the installer from the location it is downloaded.

Could you please provide me with some information regarding your algorithm for naming the files and folders within the download folder (CommonAppData\Manufacturer\Product)
- The aiu file
- The folder into which the installer package is downloaded
mtomsak
Posts: 11
Joined: Fri Mar 25, 2016 10:32 pm

Re: Updater install of downloaded update without internet connectivity

This project was suspended for a while just after the last reply, but now the project has started again. I now have some follow-up questions.

The users of our application only occasionally have internet access. We do not want to force them to run the updater manually. Instead, we want to write a background process that will run continuously on the user's laptop. It will periodically check for internet connectivity, and when connectivity is available, we would like it to run the updater to check for a newer installer version and download it if a newer version is detected. However, we do not want to install the new version at this time. Instead, we want to inform the user that a new version has been downloaded, and allow them to install it at a time that is convenient for them.

We have been able to successfully check for updates and download the newer version by running the updater with the command line switches ""/silentall -nofreqcheck -justdownload".

Ideally, we would like to be able to run the updater to install the downloaded package when there is no internet connection. However, we have not found a way to do this, either by executing the updater directly or by executing the updater with command line switches. Therefore, we have devised an alternate solution.

We would like to write an app that will execute the downloaded installation package programmatically. In order to do so, we need to know the folder path and the name of the installation package after it has been downloaded, but we do not know your naming conventions.

Could you please provide me with some information regarding your algorithm for naming the files and folders within the download folder (CommonAppData\Manufacturer\Product)
- The aiu file
- The folder into which the installer package is downloaded

Also, if a newer version 1.1.0 was downloaded, and some time in the future a newer version 1.2.0 was downloaded, how would we be able to know which one was the newest?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Updater install of downloaded update without internet connectivity

Hello,

The .ini file (updater.ini file) from the installation folder of a application contains the download folder where the updates.aiu file will be downloaded (the file from your server) e.g. for Advanced Installer it is:

Code: Select all

C:\ProgramData\Caphyon\Advanced Installer 13.0\updates\
Here, the .aiu file will be downloaded with the name that is calculated from its URL. e.g. for Advanced Installer the URL is:

Code: Select all

http://www.advancedinstaller.com/downloads/updates.ini
thus the .aiu name will be:

Code: Select all

updates.aiu
The folder where the upgraded version will be downloaded can be seen in the .aiu file e.g. for Advanced Installer it is:

Code: Select all

[advinst13.0]
The name of the upgraded version represents the value of the ServerFileName from your .aiu file. e.g. for Advanced Installer it is:

Code: Select all

ServerFileName = advinst.msi
Let me know if you have any questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtomsak
Posts: 11
Joined: Fri Mar 25, 2016 10:32 pm

Re: Updater install of downloaded update without internet connectivity

Hi Dan,

Thanks for the info. It is very helpful.

I just wanted to check if the following command line switches are officially supported by Advanced Installer.

/justcheck to check if updates are available
/justcheck -installready to check if the available updates have been downloaded
/silentall -nofreqcheck -justdownload to download the updates

Thanks,
Mike
mtomsak
Posts: 11
Joined: Fri Mar 25, 2016 10:32 pm

Re: Updater install of downloaded update without internet connectivity

I have been running some tests and have experienced some odd behavior. Let me start with a bit of background information.

For my tests, I have 3 versions of a tool named AAA_BBBBB-CCC. The versions are 1.0.0, 1.1.0 and 1.2.0. As a part of the installation package, each version includes the updater.exe (which I have named AAA_BBBBB-CCC_Updater.exe) and updater.ini (AAA_BBBBB-CCC_Updater.ini).

I have a background process that periodically checks for updates. It runs the following algorithm by executing the updater that is currently installed.

// Check if update is available
Execute AAA_BBBBB-CCC_Updater.exe /justcheck
If return code = 0
// Update is available. Check if update has been downloaded
Execute AAA_BBBBB-CCC_Updater.exe /justcheck –installready
If return code = 0xE0000011
// Update is available but not yet downloaded. Download the update
Execute AAA_BBBBB-CCC_Updater.exe /silentall –nofreqcheck –justdownload
Else If return code = 0
// Update is available and is already downloaded
Enable button that allows user to install the update from the download folder
End If
Else If return code = 0xE0000011
// No update is available, so do nothing
End If


And now for the issues. I will start with the simple one.

Issue 1:

For this test, I have the following setup on my web server.

Folder AAA_Updates
- AAA_BBBBB-CCC_setup_v1.2.0.exe
- AAA_BBBBB_CCC_Updater.txt (updater file that downloads 1.2.0 from AAA_Updates)
Folder AAA_Updates_Test
- AAA_BBBBB-CCC_setup_v1.2.0.exe
- AAA_BBBBB_CCC_Updater.txt (updater file that downloads 1.2.0 from AAA_Updates_Test)

I start with v1.1.0 installed. Upon checking for updates (either by running the updater directly or via the /justcheck option of my background process), an aiu file is downloaded to a subfolder of the ProgramData folder.

If the ini file points to AAA_Updates_Test\AAA_BBBBB_CCC_Updater.txt, the name of the aiu file in ProgramData is AAA_BBBBB_CCC_Upd.aiu.

If the ini file points to AAA_Updates\AAA_BBBBB_CCC_Updater.txt, the name of the aiu file in ProgramData is AAA_BBBBB_CC.aiu.

I need to know the name of the aiu file programmatically so I can open the file to generate the filename with full path of the installation package that is downloaded. Why are the names of the aiu files different? What is the algorithm used to create this filename?




Issue 2 – This one is more complex, so I have provided a lot of detail:

For this test, I have the following setup on my web server.

Folder AAA_Updates
- AAA_BBBBB-CCC_setup_v1.1.0.exe
- AAA_BBBBB-CCC_setup_v1.2.0.exe
- AAA_BBBBB_CCC_Updater.txt (updater file that installs 1.2.0)
- AAA_BBBBB_CCC_Updater_XX.txt (updater file that installs 1.1.0)

I start with version 1.0.0 installed. The AAA_BBBBB-CCC_Updater.ini contains these 2 lines in particular
- DownloadsFolder=C:\ProgramData\<Company>\AAA_BBBBB-CCC\updates\
- URL=https://www.server.com/AAA_Updates/AAA_ ... ter_XX.txt
By pointing the URL to AAA_BBBBB_CCC_Updater_XX.txt, the ini file is set up so that it will download and install version 1.1.0 when the updater is executed.

At this time, the c:\ProgramData folder does not have a subfolder named <Company>.

Next, the background process executes “AAA_BBBBB-CCC_Updater.exe /justcheck” to see if updates are available. This returns a result code of 0, indicating that updates are available. The ProgramData folder now has the following structure.

ProgramData
<Company>
AAA_BBBBB-CCC
updates
AAA_BBBBB_CC.aiu (this is a copy of AAA_BBBBB_CCC_Updater_XX.txt)

Next, the background process executes “AAA_BBBBB-CCC_Updater.exe /justcheck -installready” to see if the update has been downloaded. This returns a result code of 0xE0000011, indicating that the update has not yet been downloaded. At this time there is no change to the ProgramData folder structure.

Next, the background process executes “AAA_BBBBB-CCC_Updater.exe /silentall –nofreqcheck
–justdownload” to download the update. This returns a result code of 0, indicating that the download is in progress. Once the download completes, the ProgramData folder now has the following structure.

ProgramData
<Company>
AAA_BBBBB-CCC
updates
AAA_BBBBB_CC.aiu (this is a copy of AAA_BBBBB_CCC_Updater_XX.txt)
AAA_BBBBB-CCC v1.1.0
AAA_BBBBB-CCC_setup_v1.1.0.exe

The next time through the background process periodic loop, “AAA_BBBBB-CCC_Updater.exe /justcheck” returns a 0 indicating that updates are available, and “AAA_BBBBB-CCC_Updater.exe /justcheck -installready” returns a 0 indicating that the update has already been downloaded.

Next, the user presses the button to run the downloaded installer. This installs AAA_BBBBB-CCC v1.1.0. The AAA_BBBBB-CCC_Updater.ini contains these 2 lines in particular
- DownloadsFolder=C:\ProgramData\<Company>\AAA_BBBBB-CCC\updates\
- URL=https://www.server.com/AAA_Updates/AAA_ ... pdater.txt
By pointing the URL to AAA_BBBBB_CCC_Updater.txt, the ini file is set up so that it will download and install version 1.2.0 when the updater is executed.

So far everything is fine, but the problem is about to occur.

The next time the background process runs “AAA_BBBBB-CCC_Updater.exe /justcheck” to see if updates are available, it returns a code of 0xE0000001, indicating that no updates are available, and the AAA_BBBBB_CC.aiu file within the ProgramData folder has not changed. This behavior does not seem to be correct, as the 1.2.0 update is definitely available.

From this point in time, there are 2 separate tests that I performed.
1. Directly execute AAA_BBBBB-CCC_Updater.exe. It also tells me that the software is up to date.
2. Delete the AAA_BBBBB_CC.aiu from the ProgramData folder. With this file deleted, I can either run the updater directly or let my background process check for updates. In either case, the software detects that updates are available (the 1.2.0 version of the .aiu file is downloaded to ProgramData) and downloads them to folder AAA_BBBBB-CCC v1.2.0.

Also, if I go back to the start of the test where I have 1.1.0 installed and the ini file points to AAA_BBBBB_CCC_Updater_XX.txt, and then I directly execute the installed updater, it will download and install v1.1.0. Now if I execute the 1.1.0 updater (ini file points to AAA_BBBBB_CCC_Updater.txt, which should force a download of 1.2.0), again it says that no updates are available. The same is true of using the command line /justcheck option.

So ultimately, why is it that the 1.2.0 update is not detected unless the .aiu file is deleted from ProgramData.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Updater install of downloaded update without internet connectivity

Hello,
I need to know the name of the aiu file programmatically so I can open the file to generate the filename with full path of the installation package that is downloaded. Why are the names of the aiu files different? What is the algorithm used to create this filename?
As I said, the .aiu file will be downloaded with the name that is calculated from its URL. e.g. for Advanced Installer the URL is:

Code: Select all

http://www.advancedinstaller.com/downloads/updates.ini
thus the .aiu name will be:

Code: Select all

updates.aiu
So ultimately, why is it that the 1.2.0 update is not detected unless the .aiu file is deleted from ProgramData.
This may happens if the web server where the .aiu file is hosted is not reporting a correct date. The reported date is not newer that the old one when the .aiu file has been downloaded.

Let me know if that helped.

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

Return to “Building Installers”