Some questions about Auto Updater - Advanced Installer Community
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Some questions about Auto Updater

Hi Advanced Installer Support Team,

Currently I'm integrating our installer with Auto Updater and would like to get some answers from you if possible:

1. First of all I'd like to draw your attention to a potential problem of Auto Updater: in a very special scenario the updater does not refresh some of our registry entries - for example the version number is not increased - while upgrading our product. Please find my sample projects attached for reproduction and perform the the following steps:
a) Open Sample project.aip (please use Advanced Installer 12.1) and prepare a Major Build (e.g. version 1.0.0)
b) Increase the version number to 1.0.1 and create a new build for patching. Choose Keep existing option.
c) Prepare a patch using the Sample project - Patch project.aip project.
d) Create an update using the Sample project - Update project.aip project. Choose the msp file crated at Step 3 for update.
IMPORTANT: Registry problems occur only if you install your update without elevation, so that the relevant checkbox must be ticked on. Installing the patch file manually (double click on it), or else installing it through the Auto Updater with elevation all works as expected and registry entries will be up-to-date at the end of the installation.
e) Install version 1.0.0 on a 64-bit PC.
f) Confirm that the version number is 1.0.0 in "Programs and Features" as well as in the Registry under HKLM\SOFTWARE\SAMPLE\Installation\InstallVersion.
g) Trigger the update mechanism and let the product to be updated -> "Some components could not be updated..." message appears at the end because "Installed Detection" phase of the updater fails due to wrong version number in the registry.
h) Confirm the the version number is 1.0.1 in "Programs and Features", but still 1.0.0 in the Registry under HKLM\SOFTWARE\SAMPLE\Installation\InstallVersion, which is incorrect.

Some more remarks: As you might have discovered there is a completely empty feature called 32-bit in the Organization section of Sample project.aip. My investigation shows that having an empty feature in the product is a kind of requirement of the registry problem, removing it from the list and performing the reproduction steps one more time would interestingly lead to the correct version number in the registry.

Do you think it's a bug on your side or else the configuration of my project needs to be changed? Could you please have a look at my sample projects and let me know about your thoughts?

2. A bit information about the security of your support service for the updater would be highly appreciated, obviously I'd like to be sure that the service comes along with our product updates our components only and does not install anything else on customers' PC. How do you prevent your service from installing harmful content - e.g. a malware? Enabling the checkbox of "Install only digitally signed update packages with the same certificate that the Updater" of the Updater really makes it secure for us and nobody else (like hackers) can use it?

3. We have to update the digital signiture of our product from time to time, do you think this fact may lead to any problems in the future? For example what if we have an old version of our product is installed on a customer's PC with an old signiture (and of course "Install only digitally signed update packages with the same certificate..." is enabled to increase security) and then we create a new version with a new signature? I believe in this case the customer won't be able to update his product, right? Do you have a proposal or best practice for these situation?

Thanks in advance for your answers!

Best regards,
Zsolt Kollarits
Attachments
Sample project - Update project.aip
Update project
(1.24 KiB) Downloaded 539 times
Sample project - Patch project.aip
Patch project
(2.13 KiB) Downloaded 589 times
Sample project.aip
Main project
(17.5 KiB) Downloaded 789 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.

First, I apologize for the delayed reply, but we were quite busy in the last days.
1. First of all I'd like to draw your attention to a potential problem of Auto Updater: in a very special scenario the updater does not refresh some of our registry entries - for example the version number is not increased - while upgrading our product.
Please keep in mind that in order to install a patch without elevation you do not need to use the "Install support service" for the updater. You only need to sign the patch and target MSI using the same certificate and check the Enable installing of patches for this product without elevation option in the "Digital Signature" page.

If you want to use the support service without the above option, you need to set the following properties in the "Command Line" field of the "Updates Configuration" project: REINSTALL=ALL REINSTALLMODE=ecmus
2. A bit information about the security of your support service for the updater would be highly appreciated, obviously I'd like to be sure that the service comes along with our product updates our components only and does not install anything else on customers' PC. How do you prevent your service from installing harmful content - e.g. a malware? Enabling the checkbox of "Install only digitally signed update packages with the same certificate that the Updater" of the Updater really makes it secure for us and nobody else (like hackers) can use it?
Yes, enabling the Install only digital signed update packages signed with the same certificate as the Updater option will prevent the user from installing updates that are not signed with the same certificate as the Updater. Those updates will not be displayed to the users.
3. We have to update the digital signiture of our product from time to time, do you think this fact may lead to any problems in the future? For example what if we have an old version of our product is installed on a customer's PC with an old signiture (and of course "Install only digitally signed update packages with the same certificate..." is enabled to increase security) and then we create a new version with a new signature? I believe in this case the customer won't be able to update his product, right? Do you have a proposal or best practice for these situation?
The solution for this kind of situations is described in the "Migrating to a new certificate"section of the How to install only digitally signed update packages article.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Thank you very much for your answers, they were really useful for me for better understanding the update procedure!

Please be informed that both solution candidates you suggested
- Enable installing of patches for this product without elevation
- Adding REINSTALL=ALL REINSTALLMODE=ecmus command line parameters
have been tried out by me (using the initial sample projects) in order to solve our problem I've described at the first section of my previous letter, but apparently none of them are working. Unfortunately the registry's version number is still not getting updated, although a newer version of our product appears to be installed properly (increased version number is visible in Programs and Features).

Basically I think I don't have problems with installing an msp file without elevation, everything works as expected as long as I don't add an empty feature to our product. Somehow this empty feature is guilty for incorrect registry version numbers after installing the msp. Could you please have a look at it for me?

In addition a few more questions arose during my work:

1. We would like to give our product updates to our enterprise users who will make it available for their customers, however giving them always an updates configuration file (e.g. "updates.txt") along with the corresponding executable (msi, exe, msp) would mean that our enterprise user (administrator) is supposed to copy the update files (updates.txt and executable) to a shared folder on his side and also open updates.txt and modify the URL field of it pointing to the particular shared folder. Underlying clients are able to download the updates from this place then, by launching their updater.exe with -url switch that refers to enterprise's shared folder.

While I was investigating the possible solutions I've found out that one one of your customers has already opened a thread about the exact same problem, please find it under the following link:
http://www.advancedinstaller.com/forums ... =2&t=28004
In the 6th post of the thread you're telling that this issue is on your TODO list now, may I ask please if you already have any updates/solutions regarding this?
We'd like to prevent our enterprise administrators from unnecessary work by having dynamical URL field in updates configuration file. For example empty URL field could mean that executable file (exe, msi, msp) is located in the same folder where updates.txt resides.

2. You list all updater options and switches at the following link:
http://www.advancedinstaller.com/user-g ... dater.html
Based on this link I started to use the "-url <location>" switch and expected that corresponding INI file's URL will be replaced by what I defined after the "-url" part, but apparently INI stayed untouched. So the actual steps I've done:
a) Having updater.exe and updater.ini file next to each other, there is a fake url (e.g. www.example.com) in updater.ini as URL.
b) Open Command Prompt as Administrator and navigate to the folder where I have updater.exe.
c) Launch updater.exe and define a valid url where we have our updates configuration file, for example "updater.exe /checknow -url http://www.myvalidurl.com" -> at this point I'd expect that the url at INI file is being replaced, but actually it's not.
d) I'd expect that for the second time "updater.exe /checknow" is sufficient, since INI file already contains www.myvalidurl.com. -> Error message appears telling me that some resources cannot be found, because INI file still points to www.example.com.

Note: Our Advanced Installer version is 12.1.

Could you please check the incorrect version number problem once more? Getting some answers on my latest questions would be also very appreciated!

Thanks in advance!

Zsolt
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt,
Basically I think I don't have problems with installing an msp file without elevation, everything works as expected as long as I don't add an empty feature to our product. Somehow this empty feature is guilty for incorrect registry version numbers after installing the msp. Could you please have a look at it for me?
I tested the projects that you sent many times on my machine using the REINSTALL=ALL REINSTALLMODE=ecmus command line parameters and the registry was updated as expected. Can you test this on some clean machines?

I noticed that in your "Updates Configuration" project, you use a wrong version number: 21.0.1.0 instead of 1.0.1.
While I was investigating the possible solutions I've found out that one one of your customers has already opened a thread about the exact same problem, please find it under the following link:
viewtopic.php?f=2&t=28004
In the 6th post of the thread you're telling that this issue is on your TODO list now, may I ask please if you already have any updates/solutions regarding this?
We'd like to prevent our enterprise administrators from unnecessary work by having dynamical URL field in updates configuration file. For example empty URL field could mean that executable file (exe, msi, msp) is located in the same folder where updates.txt resides.
Unfortunately that functionality was not implemented yet, however I increased its priority and it will be available in a future version of Advanced Installer.
2. You list all updater options and switches at the following link:
http://www.advancedinstaller.com/user-g ... dater.html
Based on this link I started to use the "-url <location>" switch and expected that corresponding INI file's URL will be replaced by what I defined after the "-url" part, but apparently INI stayed untouched.
I'm afraid that this is the normal behavior. The "-url <location>" switch is not meant to modify the INI file, it is only sent to the updater which will use that URL one time. The updater will not modify the INI file.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Thank you for your answers on my previous questions, they are very useful for me!

Regarding the registry problem: I´ve done many tests by using the command line parameters (REINSTALL=ALL REINSTALLMODE=ecmus) you suggested me and noticed the registry is really being updated in some case but not always.

Please check the following list as the outcome of my tests:
1. Firstly I re-tested it by using some virtual machines (OS: Window 8 and Windows Server 2012) and also added the command line parameters to the Update project -> registry keys remained the old ones while Programs and Featues showed me

the new version number.
2. I used my local PC for testing -> my registry was updated.
3. Later I went back to the same virtual machines I used before -> Sometimes the registry looked fine after the update, sometimes it remained untouched.
4. Finally I tested it on a different non-virtual PC (clean machine) -> Registry´s version number was not updated.

As you can see the behavior is completely non-deterministic, nevertheless my EventViewer shows the same error messages all the time if the update operation fails:
Message 1: Product: SAMPLE -- Error 1706. An installation package for the product SAMPLE cannot be found. Try the installation again using a valid copy of the installation package 'SAMPLE.msi'.
Message 2: Product: SAMPLE - Update 'Your Patch display name' could not be installed. Error code 1603. Additional information is available in the log file C:\windows\TEMP\MSI66114.LOG.

Please find it attached the log file (MSI66114) of Windows Installer.

Could you please check the errors for me and let me know if you have any further ideas?

Best regards,
Zsolt
Attachments
Windows Installer logfile.LOG
Windows Installer log file
(235.11 KiB) Downloaded 534 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt,

I tested th patch installation again on different machines using either the "REINSTALL=ALL REINSTALLMODE=ecmus" command line parameters or the "Install only digital signed update packages signed with the same certificate as the Updater" option (in this case I signed the packages using the same certificate) and all my tests worked as expected.

Can you please send me your new .AIP files (main project, patch, update) to support at advancedinstaller dot com so I can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Thanks you for re-testing the patch installation on different machines, I also made further tests, but unfortunately my results are the same like before.

Just to be on the safe side I´ve re-created all of my samples from scratch, therefore I´ve opened 3 new AI projects and used them for testing. Please find those projects attached.

Some remarks:
1. Installing the update on my personal PC is successfull in almost all cases, it means registry and Program & Features shows the new version.
2. Using a virtual machine with the exact same processor and OS always shows an error at the end of the update procedure as well as 2 error entries in the EventViewer (for more info please check my previous letter). Registry will contain old version number in all cases. The version number of the Programs&Features section depends on the command line parameters you suggested to use: in case of using them the old version number is visible at the end of the update, otherwise the new one appears.
3. Installing the update on other non-virtual PC´s in our office: the result was the same as what you can see in the previous point.

Moreover I´ve prepared a video about the exact steps what I´m doing, including the generation of files needed (executables and updates configuration file) and the installation/update. The video is way too big (~160MB) to upload it here to the forum, do you have an ftp server or something similar where I could upload it to?

Thanks in advance for your help!

Best regards,
Zsolt
Attachments
Sample project 4 - Update project.aip
Update project
(1.63 KiB) Downloaded 539 times
Sample project 4 patch.aip
Patch project
(2.19 KiB) Downloaded 645 times
Sample project 4.aip
Sample project 4
(17.36 KiB) Downloaded 658 times
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

During my investigation I found another interesting things that might be helpful for you: checking windows installer´s log file (that I attached it previously) showed me that something might be wrong with the permissions on our virtual machines. The file contains the following lines:

"
MSI (s) (D8:5C) [15:00:56:547]: SOURCEMGMT: net source '\\vie1zsko3\e$\zsolt.kollarits\Desktop\Get back Sample.aip from AI\Sample project-SetupFiles\Outcome\2.0.0\'

is invalid.
MSI (s) (D8:5C) [15:00:56:547]: Note: 1: 1706 2: -2147483647 3: SAMPLE.msi
MSI (s) (D8:5C) [15:00:56:547]: SOURCEMGMT: Processing net source list.
MSI (s) (D8:5C) [15:00:56:547]: Note: 1: 1706 2: -2147483647 3: SAMPLE.msi
MSI (s) (D8:5C) [15:00:56:547]: SOURCEMGMT: Processing media source list.
MSI (s) (D8:5C) [15:00:56:547]: Note: 1: 2203 2: 3: -2147287037
MSI (s) (D8:5C) [15:00:56:547]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
"

Apparently Windows Installer looks for the original .msi file at the original location in order to be able to apply the .msp patch properly, however the .msi is inaccessible if the program was installed from a shared location - it might be a permissions issue. In case I copy the set of original files (mis, cab, exe) to the Desktop of the virtual machine and install the program from there, the updater is capable of installing the patch without any problems.

Could you please help me in better understanding of this procedure by answering on the following questions?

1. Having the empty feature under Organization tab still plays an important role in reproduction. How is it possible that removing that package leads to a configuration which can be patched successfully even if the initial program has been installed from shared location? Without the empty feature the location of the .msi seems to be not relevant at all.

2. Command line parameters you suggested (REINSTALL=ALL REINSTALLMODE=ecmus) must be used only if we have the empty feature at Organization, removing the packages as well as the command line parameters allows the user to install the initial program (no matter the files reside at local or shared folder) and patch it successfully afterwards.

3. Is it possible to create a patch (.msp) which does not require the original .msi? Even if the .msi still exits on the customer´s PC, some permissions might be not sufficient - like my scenario shows it, relying on a file at customer´s side is a bit risky I think.

Finally please accept a small table about the combination I tried out, hopefully it shows you better what´s the point:

Were command line parameters used (REINSTALL=ALL REINSTALLMODE=ecmus)? Is empty feature included at Organization? Location of initial executables (.exe, .msi, .cab) Patching was successful?
yes yes yes yes
no yes yes no
yes no yes yes
no no yes yes
no no no yes

The table clearly shows:
- location of files and command line parameters can be anything in case of not having the empty feature
- having the empty feature introduces some restrictions though: we must install our program from a location where .msi remains accessible (desktop) as well as use REINSTALL=ALL REINSTALLMODE=ecmus in our update project

Could you please explain me why a single empty feature causes so much trouble for patching? Thanks for your help!

Best regards,
Zsolt
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt,

I tested the patch with and without an empty feature, but in both cases it asked for the original MSI package. You can take a look on the following threads which debates the same problem and give some solution for crating a patch that will not require the original MSI package:
http://www.advancedinstaller.com/forums ... 463#p66376
http://www.advancedinstaller.com/forums ... =2&t=21777
https://msdn.microsoft.com/en-us/librar ... 2147217396
http://blogs.msdn.com/b/heaths/archive/ ... ource.aspx

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Thank you for the links you gave me, they are really useful! In the meantime I´ve figured out a potential solution for this issue by further investigation it. One of your forum threads
http://www.advancedinstaller.com/forums ... =5&t=29786
is talking about something similar and suggesting to use REINSTALLMODE="omus" option as a command line parameter. Replacing "ecmus" by "omus" helped me to install patches properly without elevation - even if the original .msi file was inaccessible for some reason.

Using REINSTALLMODE="omus" command line parameter is also fine, right?

At this point I thought I´m done as I managed to install major updates and patches without elevation, however there is still a scenario when an error has appeared on my screen. Please use my latest sample projects for reproduction (the new project builds a WebInstaller), but you can try my old ones too as not much changes have been applied.
1. Please create a Major version (e.g. 1.0.0) and a Keep existing version (e.g. 1.0.1) using the sample project.
2. Copy the files to a shared folder.
3. Create a patch using my patch project (1.0.0 -> 1.0.1).
4. Create an updates configuration file to the patch (1.0.1 msp) but please DO NOT enable "Install update without elevation" checkbox. This step is the key for getting an error. Patch installation would go fine if you would enable this box in combination with "REINSTALL=ALL REINSTALLMODE=omus" parameters. Now let´s say we´d like to show UAC dialog.
5. Feel free to try out either "REINSTALL=ALL REINSTALLMODE=omus" or "REINSTALL=ALL REINSTALLMODE=ecmus" command line parameters, but please keep "Install update without elevation" tickbox unticked in each case.
6. Install version 1.0.0 to your PC, but make sure that you click on the exe that resides in the shared folder.
7. Launch the updater.exe and try to apply Patch 1.0.1.

Result: An error dialog will show up during the installation procedure: "The filename, directory name, or volume label syntax is incorrect". From Windows Installer log I can see the installer would like to access a file under a wrongly formatted url:
"file:http://vie1qacl89/downloads/Sample%20pr ... r)/\Sample project 4 - Server.msi for computing its hash. Error:123"

Doing exactly the same steps by putting "REINSTALL=ALL REINSTALLMODE=omus" in the command line field and ticking "Install update without elevation" box on will install Patch 1.0.1 on the PC without any error dialog to appear.

Could you please have a look at this issue as well? Besides please let me thank you all your efforts you made so far!

Best regards,
Zsolt
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Please find my newest sample projects I promised right below!

Regards,
Zsolt
Attachments
Sample project 4 server.zip
Sample
(5.82 KiB) Downloaded 486 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt,

Sorry for the delayed reply.
Using REINSTALLMODE="omus" command line parameter is also fine, right?
Yes, this should be fine as long as the updates are applied. You can see what each of those letters (o, m, u, s, etc.) mean in the "Repair Options" section from the "Msiexec.exe Command Line" article.
At this point I thought I´m done as I managed to install major updates and patches without elevation, however there is still a scenario when an error has appeared on my screen. Please use my latest sample projects for reproduction (the new project builds a WebInstaller), but you can try my old ones too as not much changes have been applied.
I tested the scenario you described on many environments and I noticed that this problem seems to be generated by some Windows Updates. Testing the scenario on a machine that has all the Windows Updates applied I was able to reproduce the behavior, but on a machine that do not have the Windows Updates applied, the patch was installed successfully. Can you test the scenario on a machine that does not have the Windows Updates applied and see if it works?

This problem was also discussed on the "minor patch update error" thread. We also reported this to Microsoft support, but we did not get a conclusive answer yet.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

Re: Some questions about Auto Updater

Hi Eusebiu,

Unfortunately I´m not able to test the behaviour on a clear machine, anyway I don´t think it makes too much sense as most of the customers are having PCs with updates installed on it.

For now if we ever want to create an update which requires elevation (Install updates without elevation checkbox is off) then we use normal updates (msi or exe) instead of patches (msp). Nevertheless please let me know if you get an

answer from Microsoft, so that I´ll know when this problem is fixed.

Best regards,
Zsolt
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Some questions about Auto Updater

Hi Zsolt,

Yes, we will update this thread as soon as we get a conclusive answer from Microsoft.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Some questions about Auto Updater

Hello,

An improvement to configure the Updater to use an updates setup download URL relatively to the updates configuration file download URL was added in Advanced Installer 15.8, released on March 20th, 2019.

Basically you could configure the Updater to look for the updates setup package on the web server hosting the updates configuration file at a URL built relatively to the download URL of the updates configuration file. Also, this approach works only for local network paths using the "file" protocol.

For instance, accordingly with the URL you configured in "Updates configuration file URL" field from "Updater" page of your setup project, if the Updater looks for your updates configuration file at the following file URI address:

Code: Select all

file://e:\test\updates.txt
and you want the updater to automatically compute at runtime the URL of the updates setup and try to download it from a URL like this

Code: Select all

file://e:\test\updates.msi
then you should just configure your updates configuration project like this:
1. go to "Updates" page -> "Properties" tab and set the "Main URL" field like this:

Code: Select all

file://
2. leave "Mirror URL" field empty
3. build your updates configuration project

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”