matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

MSI installer with prerequisite (Post-install) reboot?

Hi,

I am building an MSI installer that has one pre-requisite MSI.

1. If the pre-requisite is not installed or needs to be upgraded, a reboot has to happen at the end of the main installation or the upgrade.
2. If the pre-requisite does not have to installed or upgraded, no reboot should happen.
3. The installer needs to be deployed with minimum user interface, using deployment tools such as policies and others. (Silent)

I have tried a few options for 2 days now but was unable to get this working right. Can you please help?

If at all possible, the installer should remain an MSI.

Thanks,
Matt
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Matt,

Here is what you need to do.
You need to determine in the main installation package if the prerequisite needs to be installed. For this, you can create same searches from the Prerequisite Install Conditions Tab of the prerequisite in the Search page.

Then, you can set a property e.g. REQUIRE_REBOOT with Yes value using Set installer property predefined custom action. Condition the execution of this custom action depending the result of your searches.

If the prerequisite needs to be installed, then make sure you set this property too.

Then, you can create another help setup package(e.g. create a new project in Advanced Installer. Go to Product Details page and uncheck the option to "Register product with Windows Installer". ) which will be added as a post-install prerequisite after the existing one. Pass this property, REQUIRE_REBOOT through the Install Commands Line field from the Setup Files tab of the prerequisite.
In this help setup you can set the REBOOT property only if the REQUIRE_REBOOT property is Yes.
Please take a look on the Change in the reboot behaviour forum thread which may be useful to you.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Dan,

thank you for your reply. I must be thick in my head - simply can't get this to work. I have tried your approach without much luck. I'll attach 2 dummy projects to this reply, one is the main installer and the other is the pre-requisite. I have set the pre-requisite to not reboot and the main installer to only reboot when the pre-requisite has been installed.

One of the problems I have is that the pre-requisite stubbornly insists on rebooting no matter what I do. I would also like to remove the pre-requisite on un-install (but not upgrade). I have set a custom action but so far this has not worked either.

We are using the Enterprise version.

Can you please have a look?

Thanks,
Matt
Attachments
prerequisite.aip
(11.04 KiB) Downloaded 1177 times
main.aip
(17.11 KiB) Downloaded 719 times
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

When I install the pre-requisite (dummy) separately, there is no reboot prompt.
If I install it as the pre-requisite with the main msi, I am getting a reboot prompt on install and also when I remove it manually from the control panel

It seems like the installer modifies the REBOOT property of the prerequisite...
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

This is becoming a bit of a monologue, but I have figured out something important.

I have increased the version of the pre-requisite msi. I have run it directly, not as part of the main installer and it shows up with the new version and no reboot prompt

I un-install the pre-requisite.

Then I run the main installer which installs the pre-requisite, I am getting a reboot prompt. Now the surprise: The version of the pre-requisite is the older version.

So somehow, the main installer is installing a cached version of the pre-requisite msi. Where is that cache? I have set the options of both the main and the pre-requisite aip projects to not cache. I checked that there are no cached folders.

Because both aip projects were in the same folder, I have created a new folder for the pre-requisite and also moved the media target to that folder. I modified the main aip to pick the pre-requisite up from the new location and gave it another run. But again, I am getting the reboot prompt with the pre-requisite and the application panel shows the older version.

Where does this old cached MSI come from???
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

I found the cached msi. It was in : C:\Users\matt.luthi\AppData\Roaming\[Manufacturer].

After I deleted everything in there, I was able to install the main package with the pre-requisite just fine.

I am going to call this a bug on AdvancedInstaller.

I found a log presumable generated by the advanced installer during compilation in C:\Users\matt.luthi\AppData\Local\Temp. It has an interesting entry:

MSI (c) (6C!44) [12:13:21:915]: PROPERTY CHANGE: Adding AI_PREREQFILES property. Its value is 'C:\Users\matt.luthi\AppData\Roaming\matt\MainApp\prerequisites\prerequisite.msi'.

which is the proof that advanced installer is fetching the prerequisite msi from a cached location, clearly problematic when it is supposed to pick that up from "c:\test\prerequisite\" as I have it configured in the main package.

This has cost me days of mind numbing work. NOT HAPPY!
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

Okay Dan, I have created another aip package that does not register with windows installer and send the REQUIRE_REBOOT property to it so it then triggers a reboot.

It worked once.

The warning that came up when I unticked the "Register Product with Windows Installer" indicates me that once it is installed, it cannot be removed. So I guess it would only run once.

Is this correct?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Matt,
The warning that came up when I unticked the "Register Product with Windows Installer" indicates me that once it is installed, it cannot be removed.
Indeed, if the Register product with Windows Installer option is unchecked, you cannot remove, repair or reinstall the application by using the Control Panel, the Windows Installer command-line options or the Windows Installer application programming interface (API).
So I guess it would only run once.
Every time you run the installation package, it will behave as First Time Installation (e.g. it will not enter in MaintenanceMode).

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Dan, yes - when I launch the rebooter msi directly it does indeed execute every time. I have added a custom action showing a popup to it. '

I have added it to the main msi as a post-install pre-requisite, and I am passing the [REQUIRE_REBOOT] property to it in "Install Command Lines" on the "Setup Files" tab. In Install conditions, I have set it to "Alway install prerequisite".

However, when I launch the main installer, that popup never shows, meaning that post-install prerequisite is never run.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Matt,

In order to have a better view about this, can you please attach to the forum thread the very last .AIPs(project file) which you are using?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Matt,

I've attached a sample project to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

If you have any question, please let me know.

Best regards,
Dan
Attachments
Sample.zip
(630.92 KiB) Downloaded 710 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Dan, that does the trick thanks.
matt.luthi@gmail.com
Posts: 44
Joined: Thu Jun 20, 2013 4:42 am

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Dan, your example only works in full UI mode. My requirement is to be able to run this in silent mode as well.
Is there a way to make it also work in silent mode?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: MSI installer with prerequisite (Post-install) reboot?

Hi Matt,

If you want to launch your main installation package silently, you can use a command line statement like this:
msiexec.exe /i "C:\Example.msi" /qn
Please take a look on the Command Line article with related information for hints and guidance.

If you set your main package as an .EXE, then you can pass the /qn statement to the .MSI though the MSI Command Line field from the Configuration tab of Media page.

If you want to launch all your prerequisites silently, then you can pass command line switches through the Install Command Lines fields from the Prerequisite Setup Files Tab.

If you have other questions, please let us know.

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

Return to “Building Installers”