DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

Installer reinstalls driver each upgrade

Our installer includes a simple hardware driver (one .inf and one .sys for a simple USB device) that is rarely updated. However, we do update other components, and release a new installer every few weeks.

Each time an upgrade is done to the new version, the installer seems to be uninstalling the driver from the system, then it installs it again(the same version). Is there any way to prevent this behavior? Our driver is unsigned so each time an upgrade is done we must go through the add/remove hardware wizard each time.

The same thing seems to happen for a .NET object we install into the GAC. However, with that, if we don't change the version number each install (even if the file hasn't changed), the old version is uninstalled and then not reinstalled, leaving it missing from the system. If we run the exact same installer without having a previous version, the object is installed into the GAC just fine.

These aren't huge issues, just inconveniences that we would like to address if possible.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

This is the default behavior of AI, on upgrade the old package is uninstalled completely before installing the new one. But we shall investigate to see if we can change this behavior.
The same thing seems to happen for a .NET object we install into the GAC.
This is due to a bug of windows installer and the workaround is to increase the version of the file with each release (as you already do).

Thank you for bringing those to our attention.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
foleym
Posts: 8
Joined: Mon Oct 02, 2006 7:51 pm

Driver uninstalled

I too would like to know if this has been addressed in any subsequent releases. We are running 4.2.

We often upgrade, but never change our USB driver. After each upgrade the installer uninstalls and reinstalls our USB driver. The result is the user has to run through the "New Hardware found" wizard after each upgrade.

Is there a way around this?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You get this behavior because on upgrade the old version is uninstalled before installing the new one. This is done when the "RemoveExistingProducts" standard action is reached. We have on our TODO list the possibility to allow the user to change the sequence of this standard action.

For now what you can do is to modify (using ORCA) the MSI file and change the sequence of the "RemoveExistingProducts" standard action ("InstallExecuteSequence" table) with a sequence immediately before "InstallFinalize".

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

Is this step still needed, or does the newer version of Advanced Installer take care of it?

Also, does the new version use DIFxApp 2.1?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
Is this step still needed, or does the newer version of Advanced Installer take care of it?
I'm afraid that Advanced Installer still doesn't support this. However, a more efficient workaround is to use another MSI package to install the driver (and nothing else). This MSI package can be used as a prerequisite for the main MSI.

This way, the driver will be installed only if it is not present. Also, when you release a new version of the driver (in a new version of the prerequisite MSI package), you can set the prerequisite package to upgrade the old driver.

You can read more about prerequisites here:
http://www.advancedinstaller.com/user-g ... requisites
http://www.advancedinstaller.com/user-g ... sites.html
Also, does the new version use DIFxApp 2.1?
Yes, beginning with the 6.0 version Advanced Installer uses DIFxApp 2.1.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

cosmin wrote: I'm afraid that Advanced Installer still doesn't support this. However, a more efficient workaround is to use another MSI package to install the driver (and nothing else). This MSI package can be used as a prerequisite for the main MSI.

This way, the driver will be installed only if it is not present. Also, when you release a new version of the driver (in a new version of the prerequisite MSI package), you can set the prerequisite package to upgrade the old driver.

You can read more about prerequisites here:
http://www.advancedinstaller.com/user-g ... requisites
http://www.advancedinstaller.com/user-g ... sites.html
That is a much easier solution. Are there any special settings I need to create for that MSI? Or do I just start up a blank project in Advanced Installer, add teh stuff for the driver, and build it into an MSI.

Speaking of which, is it possible to bundle other components into MSI installers and have one installer install those components (not necessarily as a prerequisite).

If you have a .exe file that installs something else you want with your program, what is the best way to do that? I know you can add it under the custom actions stage, under the commit section, but that doesn't seem ideal since it doesn't give the user the ability to select if they want that component or not.

Thanks for the quick support.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
Are there any special settings I need to create for that MSI? Or do I just start up a blank project in Advanced Installer, add teh stuff for the driver, and build it into an MSI.
There are no special conditions. You simply create a new Advanced Installer project, configure it to install your driver and add the generated MSI as a prerequisite to the main installation package.
If you have a .exe file that installs something else you want with your program, what is the best way to do that?
If your application requires other applications to be installed, then the best approach is to add these applications as prerequisites.

However, you can also add the installation packages of these application as custom actions in the "Custom Actions" page, as long as they are not MSI-based (two MSI-based installation packages cannot run at the same time).

If you want to condition their installation based on the user's choice, you can use a checkbox or radio button group control in the "Dialogs" page. You can use the property of this custom control to condition the custom action.

You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

Also, you can read more about the Dialog editor here:
http://www.advancedinstaller.com/user-g ... ditor.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

Thanks again for the help.

We have one more issue we've run into.

We have the separate MSI installer specifically for the driver. On a new system without our software, it works fine.

However, when we are doing an upgrade from an older version (where the driver was installed side by side with everything else) the driver doesn't work properly after the install finishes. I believe this is because of the following sequence of events;

Installer starts & checks prereqs -> It sees that there is a copy of the driver so doesn't install the MSI file containing it -> Install proceeds as normal and finds the old version of the product -> System removes the old version of the product (uninstalling the driver) -> installs new version of product (minus driver since that's in the MSI)

This ends up leaving the system with all the product files, but without a copy of the driver.

Is there a simple fix to this? So far our only ideas are to force the user to manually uninstall the old version first, which should work as then the MSI with the driver will install before the main product. However, we would like to prevent that option if possible.

The other way we were considering was just auto-running the prereq installing the driver each time, but were unsure if two products install the driver, will the uninstall of the old product still remove the driver (or will it realize that something else installed it more recently and let it stay).

Thanks again.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I'm afraid that this approach will not work for previous installated packages because the driver is installed with your application (only one MSI package is used).

For conditionally upgrading the driver, the scenario would be this:
- install the main MSI with the prerequisite on a clean machine
- when a new version of your application and of the driver are released, the new prerequisite MSI will upgrade the old prerequisite MSI and the new main package will upgrade the old main package
- if the driver is the same, the prerequisite MSI will not be installed and only the main package will be upgraded.

When you want to upgrade both your application and driver, then the only solution which will work as expected is to perform a full upgrade of the old package (the old driver is uninstalled and the new one is installed).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”