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

Persistent properties during update don't seem to be persistent.

Mon Mar 30, 2020 12:12 pm

Hi again,

I'm running into an issue where the persistent properties i set during installation don't seem to be used/passed to the updater.exe file when I run it.

I have it configured as a scheduled task with two actions, the first is a configuration update. It uses powershell to grab the config location from the registry and then builds a URL to the remote server, then downloads the config files. The second action runs an updater.exe file to check for any recent update to my application.

When i run this task from the task scheduler, it goes and grabs the configs but the updater.exe doesn't run. The windows event viewer says the update.exe file executed successfully but looking in the logs on the server where the update is installed the request for my update.conf is never received. I can run this task multiple times, and the configs are dwnloaded but never the update.

If i run the exectuable manually from the installation directory, it reaches the server and downloads the update. The problem is when it does this, it fails. I've checked in event viewer and it is failing when trying to download a config file.

this is failing because the URL set during installation is blank during the update. I get a url of http://config.conf (it should be http://servername/config.conf)

Because this URL is set during installation as a persistent property I'm expecting the update to use the value in the registry. It seems it does not and the update fails.

I've created a persistent property with a blank value, using the comments instead. I think this is how I create a persistent value. When the initial installation completes the values are written to the registry.

It's as though the update is removing the registry entries during installation, causing the installation to fail ..

Can anyone help? I can forward my project file if that helps, I'm not the best at explaining msyelf sometimes.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent properties during update don't seem to be persistent.

Tue Mar 31, 2020 11:56 am

Hello Phil and welcome back to our forums,
I've created a persistent property with a blank value, using the comments instead. I think this is how I create a persistent value.
In order to create a persistent property, you have to check the "Set persistent property" checkbox for that property.
It's as though the update is removing the registry entries during installation, causing the installation to fail ..
In a normal scenario, this is indeed what would happen. The first version is first uninstalled and then it is followed by the installation of the second version. However, if the property is set as persistent, this should not happen.

Also, one thing I would like to mention here is the fact that if, at install time, you set a property to an empty string, the value will be reset to its default value during an upgrade. Let's consider the following scenario so we can better understand this:

- in Install Parameters page, we set the following property:

Code: Select all

MY_PROP -> MyValue
Let's say we want to assign this property to a dialog control (e.g. an edit box). If during install, we let the edit box control empty, the property will also be empty and will be written as empty in the registries.

- if we now increase the version of our setup to generate a major upgrade and launch this setup, we can notice that the property that was earlier set to am empty string now has the default value of "MyValue" which we have given in Install Parameters page (we can notice this because the edit box will have this value).

However, the other way around should be working just fine (when you set a property as empty at first and then give it a value through a dialog control).

The first scenario is indeed working as intended, as even if a property is set to empty string and written in registries, a Windows Installer search can not set a property to empty string at install time. We have to keep in mind that an empty property does not really exists, at least in the predefined support Microsoft offers through the Windows Installer technology.

A property can have two states:

- it has a value, therefore it exists

- if has no value, therefore it does not exist

By default, setting a property to an empty string means deleting it, therefore the Windows Installer search can not set a property to an empty string because that would mean to delete it, thus it is relying on the default value of the property.

In the past, it was not possible to set a property to an empty string. We were able to achieve that through a custom approach (by adding the comment section).

I am not quite sure, but I believe you are in the second scenario here (which should be working just fine. However, I have explained the first scenario as I am not 100% sure we are in the second scenario right now).

One thing I would like you to do and that is:

If you are in the second scenario

Make sure that the property written in the registry page have the same name as the property you defined in the Install Parameters page. If this is not the case, then please remove your property and readd it.

Hope this will help somehow.

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: Persistent properties during update don't seem to be persistent.

Wed Apr 01, 2020 3:45 pm

Hi Catalin, thank you.

I'm not quite sure which situation i am in, but i think there might be something i've changed or misconfigured. If i go to the registry page in AI I only have entries for current user > software > manufacturer > productName. This contains "version".

If i look in hkey local machine >software > Manufacturer > productName there are no entries. Should there be?

If i go to the table editor, and into registry from there i can see the properties that should be stored in the registry. I've attached screenshots of the table editor and install parameters. The names look to match.

the type and location tags and the config location are set to persistent properties. One thing i did notice, if i leave the "value" blank for my persistent property, then when running the installer i get an extra option in the drop down menus that populate those tags, the installer sees this as an acceptable value (the "next" control is disabled unless specific values are picked). if i add a default selected value from the dropdown then this value is added to the install parameters default value.

so if the default value is blank because its a persistent property (i think it needs to be blank to work?) then when the installer runs silently it will accept the empty value for CONFIG_LOCATION - This location is used to download the required config files. The update fails at this point.

I'm not sure which of the 2 situations this puts me into, i know i had this working before (or I'm losing my mind!) but i need to keep location, type and config location during an update so i can use the stored values, I don't want to update each one manually.....there's hundreds :( .
Attachments
install parameters.png
install parameters.png (23.77KiB)Viewed 3943 times
table editor registry.png
table editor registry
table editor registry.png (62.07KiB)Viewed 3943 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent properties during update don't seem to be persistent.

Mon Apr 06, 2020 3:30 pm

Hello Phill,
I'm not quite sure which situation i am in, but i think there might be something i've changed or misconfigured.
No worries, we will figure this out.
If i go to the registry page in AI I only have entries for current user > software > manufacturer > productName. This contains "version".
This makes me think that perhaps your installation type ("Install Parameters" page) is of "per-user" type (not "per-machine" type).

However, please keep in mind that persistent properties are written in the registries at install time (by one of our custom actions), therefore it will not be visible in your project, in "Registry" page.

Indeed, in the "Table Editor" page, you can see the entry.

In order for me to further investigate this, could you please forward me the following resources:

- a copy of the older version of the .AIP file (the one that's used to generate the older version)

- a copy of the newer version of the .AIP file (the one that's used to generate the newer version)

- a download link for the older version of your setup

- a download link for the newer version of your setup

- a test case (with expected & actual results if possible)

by e-mail at support at advancedinstaller dot com.

Once I receive the files, I will further investigate this and hopefully we will figure this out. :)

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: Persistent properties during update don't seem to be persistent.

Wed Apr 08, 2020 4:24 pm

Thanks Catalin, sorry for the delay.

This is one of a few different things I'm working and have been struggling to find time to come back to it. I'll try and get them over to you ASAP, although I'm not sure i still have the older version. I only have one AIP file which I've used throughout, should i be keeping separate copies of these? I thought I'd seen in the documentation that was a bad way to maintain the AI projects

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent properties during update don't seem to be persistent.

Fri Apr 10, 2020 2:23 pm

Hello Phill,

No worries about the delay.

In what regards the copy of an .AIP file, usually, when you upgrade a project, a backup copy is automatically created. If you have that, please forward it to me, otherwise hopefully just one version of the .AIP file will suffice.

Also, take your time (no need to hurry). Whenever you believe is the right time, please forward the resources by e-mail and I will have a look over them.

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: Persistent properties during update don't seem to be persistent.

Tue Apr 14, 2020 11:20 am

Hi Catalin, thanks for your understanding.

I've forwarded the AIP and installer over to the support email address along with some other versions of my application and copies of some of the older AIP files, hopefully they are of some use to you. I've sent them as a OneDrive link.

If you could point me in the right direction for the back up copies of the AIP file i will try and find them and hopefully be able to match them up to the different versions of the installer I've made.

Hopefully it makes sense :D

Please let me know if you need anything else from me.

Thanks,

Phil

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent properties during update don't seem to be persistent.

Wed Apr 22, 2020 2:12 pm

Hello Phil,

I have answered you over the e-mail.

Let's continue the conversation there until we have this figured out.

Looking forward to hearing from you.

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

Return to “Building Installers”