rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Missing properties in feature-based prerequisite installation

I need to install a feature-based prerequisite package with my main program. Some parameters, such as APPDIR, need to be passed to the package.
SubApp.png
SubApp.png (36.52 KiB) Viewed 11564 times
When I run the installation with the UI, everything works as desired. However, the installation must be performed automatically in silent mode.

In this case, the wrong or empty parameters are passed to the package.
invalidAppDir.png
invalidAppDir.png (19.58 KiB) Viewed 11564 times
Example and logfiles:
prerequisite.zip
(39.38 KiB) Downloaded 103 times
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello Rene,

Thank you for the provided resources.

I have managed to reproduce the issue on our end and created a ticket so that this can be fixed.

Unforunately, I wasn't able to find a workaround for this to give you until this is fixed. :(

Once this will be fixed or if I find a workaround, I'll update this thread.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin

Thank you for creating the ticket. Is there any news about this ticket? Currently, this is one of the biggest problems preventing me from using AdvancedInstaller in production.

Regards
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,

You are always welcome!

Regarding the question, from what I can see, the issue is currently under testing so that should be it should be available in our next release (scheduled for ~Monday 19th).

If this is a pressing issue for you and want the version earlier, I can ask the dev team to make a RC version and I can send a download link for that via email, after the testing is done.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin,

Thank you for your support. If possible, I would like to test the RC before January 19.

Best regards,
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,

You are always welcome!

I have discussed with our QA team and the RC should be available tomorrow, January 13th. :)

Once it's available, I will forward you a download link via email.

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

Re: Missing properties in feature-based prerequisite installation

Hello René,

As promised, I provided the download link via email.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin,

Unfortunately, I am still experiencing issues with the installation of my SubApp.

I have installed the latest version and created the property SILENTPREREQSAFTERINSTALL=1.

The good news is that the SubApp files no longer simply disappear after installing an update. The problem now is that the properties are lost during an update, which means that services, for example, no longer run after an update.

I have created a test project.
TestProject.zip
(21.1 KiB) Downloaded 86 times
The batch files can be used to simulate the process.

Run1.cmd
- Create v1
- Initial installation with specification of properties
- Display of correct values in the test file that is installed with the SubApp.
ok.png
ok.png (10.6 KiB) Viewed 10412 times
Run2.cmd
- Create v1.1
- Update installation without specifying properties
- Display of incorrect values in the test file that is installed with the SubApp.
failed.png
failed.png (11.49 KiB) Viewed 10412 times
It can be seen that after Run2.cmd, the properties are no longer set.

Automatic software distribution cannot currently be used in this way.

Kind regards,
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,

What happens here is the normal behavior.

During v1 installation, you pass the properties via command line, while in v2, we no longer do that.

In v2, the properties are empty and that's how they are passed to the prerequisite installer.

If you want the properties to preserve their value during upgrade, we have to set the properties to be "persistent".

How do I make the properties in the package keep their values during Maintenance or Upgrade?
Screenshot_102.png
Screenshot_102.png (14.92 KiB) Viewed 10065 times

This way, the properties will retain their values during upgrade.
Screenshot_103.png
Screenshot_103.png (9.58 KiB) Viewed 10065 times

Hope this helps! :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin,

This approach works for the initial installation and for subsequent updates where nothing changes. In my scenario, however, the command line is just one way to make changes to an already installed configuration.

If I change properties for example, SUB_MSI_INSTALL_PARAMETER before creating the next version for an update (e.g., because a new feature has been added) and then install that update, the saved properties and features are restored, but the desired changes are not applied.

%ADVINST_COM% /edit ".\TestSubMSI.aip" /SetProperty SUB_MSI_INSTALL_PARAMETER="ADDLOCAL=Service,Feature1 START_SERVICE=0"
NothingChanged.png
NothingChanged.png (34.97 KiB) Viewed 9987 times
It seems to me as though the upgrade installation of a Sub-MSI is completely detached, and the passed command-line parameters no longer play a role.

Testproject V2:
TestProjectV2.zip
(20.29 KiB) Downloaded 74 times
Kind regards,
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,

While I understand your scenario here and I can tell it is a valid scenario, I'm afraid that we might need some custom work done to make it work.

Windows Installer (the technology Advanced Installer is built upon) does not even support preserving the values of properties between versions. This is something custom that we have added to help our users with that. The "preservation" is done via saving the value of the property and then repopulating it in v2 via a custom action.

In your case, you want to preserve the value if it hasn't changed or change the value in case the user wants to change it.

Achieving this can be a little bit complicated programmatically. The safest and easiest way would be to always pass the parameters via command line, like we do when installing V1.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin,

The issue for me here is that the "Custom Code" I would need would either have to be implemented from outside the installer or I would need to find a way to transfer the data already present in the MainMSI to the SubMSI via a CustomAction.

The problem is that this implementation wouldn't just be required for my current project and any future ones, it would be necessary for anyone using a SubMSI who wants to enable automatic updates. Currently, the AI suggests that this feature already exists, but in practice, nothing is working.

Regards,
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,
or I would need to find a way to transfer the data already present in the MainMSI to the SubMSI via a CustomAction.
The properties are properly passed to the SubMsi, the problem here comes from the fact that the properties are empty during the upgrade because we no longer set them via command line.

The properties you are setting have no initial value. The first time we install, we pass the values and they are propagated correctly.

On upgrade, if you do not provide any values, the setup will get the values from the Properties page, which is an empty value - this is normal behavior.

We can avoid this by setting the properties as persistent - this will ensure the properties are repopulated with the previous values in V2.

Now, in V2, if you provide the property values and the properties are persistent, the property value will be overwritten by the previous value becuase that is how persistent properties work.

Unfortunately, although the scenario is valid, this is a corner case here. :(

To overcome this, as I said, we would need a custom action that handles the two scenarios above.

Here would be the logic:

- first, we need to save the properties in the registry (via Registry page) at install time
Screenshot_108.png
Screenshot_108.png (21.86 KiB) Viewed 6254 times
Note: or we can have the written into a TXT file in %temp% so it does not require admin privileges.

- in v2, we can have a custom action that searches those values, retrieves them and then compares with the value of the property

example for a PowerShell custom action:

Code: Select all

# we do the search and retrieve the value in the $service_password variable
# we then retrieve the value of the property passed or not passed by the user
$serivce_password_prop = AI_GetMsiValue SERVICE_PASSWORD

# we now handle the two cases
# case 1 if the prop is empty, we set the value of SERVICE_PASSWORD to the previous value retrieved
AI_SetMsiProperty SERVICE_PASSWORD $service_password

# 2nd case would be if the values are different, in which we set SERVICE_PASSWORD to the desired value
AI_SetMsiProperty SERVICE_PASSWORD $service_password_prop
Hope this helps! :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 70
Joined: Tue Mar 14, 2017 8:27 pm

Re: Missing properties in feature-based prerequisite installation

Hello Catalin,

Thank you for looking for alternatives to solve the problem. However, I would prefer not to cache these properties as a file or in the registry. As I am running out of time to solve the problem, the consequence for me is that I cannot use feature-based prerequisite installation. I will therefore invest the time and integrate the prerequisite into the main package.

Best regards,
René
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Missing properties in feature-based prerequisite installation

Hello René,
Thank you for looking for alternatives to solve the problem.
You are always welcome! And I'm sorry we could not find a solution together that meets your expectations. :(

Not even sure there is one, to be honest, as this exact approach is what we are using ourselves for the "persistent properties" support (which is something custom, does not come by default with Windows Installer).

Let me know if there is anything else I can help you with and I will gladly assist.

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

Return to “Common Problems”