Property not used on repair - Advanced Installer Community

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!

clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Property not used on repair

Hi,

We have an installer package that has certain properties that we place into a .ini file. Sometimes we override the default values of these properties by passing PROPERTY=value to msiexec command line to change the settings in the ini file, now we have got this working on upgrades by making the entry in the ini file to 'Create or update' and by making its component 'Permanent'.

We also want this ability when performing repairs; i.e. when executing the following command 'msiexec /fa package.msi PROPERTY=new-value' we would like the ini file to get the new value.
This does not seem to be working currently, it just places the property's default value into the ini file. I assume the new property value is not used in the repair.

Please advise.
Attached you can find an example project that reproduces this.

Thank you
Attachments
test-ini.aip
(11.98 KiB) Downloaded 377 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Property not used on repair

Hi,

We are aware of this problem and it looks like this is an Windows Installer limitation. The problem was also discussed in the /FA command Questions thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Re: Property not used on repair

Hi,

Ok. Are you aware of any workarounds, like the possibility of uninstall/install with the same version? As far as I am aware that cannot work.

Thank you,
Clive
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Property not used on repair

Hi Clive,

It works if you use /i instead of /fa in command line and choose "Repair" in the Maintenance dialog.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Re: Property not used on repair

Hi Eusebiu,

The problem is that we require it to be automated with no user interaction for deployment of the msi package.
Are you aware of any additional commands we could pass in to the /i option to install and repair without a UI. I've tried using it with /qn and /qb with the same version and it doesn't run a repair.

Thank you!
Clive
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Property not used on repair

Hi Clives,

After many tries, I found that if you use the "v" flag in your command line, the property you want to modify will be updated. For example

Code: Select all

msiexec.exe /fav package.msi PROPERTY=new-value
The "v" flag runs your application from the source and re-caches the local installation package.

Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Re: Property not used on repair

Hi Eusebiu,

That works for us.

Thank you!
Clive
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Property not used on repair

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Re: Property not used on repair

Hi Eusebiu,

On the other hand we are not able to easily detect if the version that is installed is the same version that we are attempting to install or repair. Since typically we would run an msiexec /i if it is an older version and an msiexec /fav if it is the current version.

We required this since it is for automated software deployment, so these would run with the /qn option.
But if it is possible to run msiexec /i with the UI and then repair can be selected, do you know if we can do this dynamically in the MSI installation process, eliminating the need for us to detect whether we need to run msiexec with the install or repair command.

So in summary, when running msiexec /i package.msi /qn, can we detect if the version that is installed is an older version or the current version and put the installation in install or repair mode respectively?

Thank you for your help!
Clive
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Property not used on repair

Hi Clive,

I'm afraid you cannot run an MSI with the "msiexec /i package.msi /qn" command and than put the installation in install or repair mode based on a condition.

I will describe below a workaround for your problem and also attach a sample project, so you can take a look on it. Steps to follow:

- create the MSI you want to install via command line (i.e. MainMSI)
- create another MSI that will contain the "MainMSI" package as a "Feature-based" prerequisite (i.e. ContainerMSI)
- go in the Install Parameters page and create a new property (i.e. Name: PROP, Value: default in case you want to pass a value to the "MainMSI" package as you said in your first post)
- go in the Prerequisite page and add the "MainMSI" package in the "Feature-based" folder twice and rename them (i.e. "NewerVersion" and "SameVersion")
- go in the "Setup Files" tab of the "NewerVersion" prerequisite and in the "Silent (No UI)" text field write the following command: /qn UPDATED.PROPERTY=[PROP] (this command will run in case the "ContainerMSI" package is launched silently)
- go in the "Setup Files" tab of the "SameVersion" prerequisite and in the "Silent (No UI)" text field write the following command: /fav /qn UPDATED.PROPERTY=[PROP] (the "PROP" property is passed to the "UPDATED.PROPERTY" from the "MainMSI" package)
- go in the "Install Conditions" tab and check the "Always install prerequisite" radio button for both prerequisites
- go in the Search page, create a "Product Version (identify by Product Code)" search, select the "MainMSI" product code and rename the search i.e. PROD_CODE (this search must be modified every time you increase the version of the "MainMSI" package)
- go in the Organization page, select the "NeverVersion" feature, check "Install based on condition" radio button and set the condition: NOT PROD_CODE
- go in the Organization page, select the "SameVersion" feature, check "Install based on condition" radio button and set the condition: PROD_CODE
- build and run the project

Now, you can run the following command in an elevated console: msiexec.exe /i ContainerMSI.msi /qn PROP=newValue and have the following three behaviors:
1. If the "MainMSI" package is not installed it will be installed with the following command: /qn UPDATED.PROPERTY=[PROP]
2. If the "MainMSI" package is already installed with the same version the following command will run: /fav /qn UPDATED.PROPERTY=[PROP]
3. If an older version of the "MainMSI" package is installed the following command will run: /qn UPDATED.PROPERTY=[PROP]

Please take a look on the attached project and let us know if you have any question.

Best regards,
Eusebiu
Attachments
MSI cmd line condition.aip
(17.09 KiB) Downloaded 450 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”