pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Shared PDF Printer

I have two programs which both install the same PDFprinter. They work perfectly individually however if I install both programs on the same machine and then uninstall one of them the printer is removed for the remaining program. I can understand this as there are some common registry entries going to the same location. How can I create an installer which only removes the printer if it is the last remaining program? is this a chained installation ?
Thanks
Paul
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Shared PDF Printer

Hello Paul,

The files and registry entries should be preserved automatically by Windows Installer if their components have have the same GUID on both packages. Since the behavior indicates otherwise, this is what you can try to avoid it.

The components' GUIDs can be modified from the Organization Page.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Shared PDF Printer

Thanks Mihai,

component GUID's always caused me problems with the installer. It's so easy to get confused.

On the subject of chained installations which I think can achieve the same goal and stop me getting GUID in a muddle. Does a chained installation embed the chained msi in the parent msi ? I think not but I am just checking.

regards
Paul
octavian.vasilovici
Posts: 51
Joined: Tue Jan 25, 2011 2:43 pm

Re: Shared PDF Printer

Hi Paul,
Does a chained installation embed the chained msi in the parent msi ? I think not but I am just checking.
The chained installation is usually distributed as a single MSI file which contains all chained packages. When this MSI is launched, it will extract the packages and launch them one after another.
On the subject of chained installations which I think can achieve the same goal and stop me getting GUID in a muddle
In your case no. The only thing a chain installation will achieve is that both the package will be installed one after the other without the need for the user to manually launch each MSI package individually.

Like Mihai said, in order to prevent deletion of the shared driver files if one of the package is uninstalled you will have to use the same GUIDs for the shared components.

Best Regards,
Octavian
_______________________________________________________________________________________________________________________________________________
Octavian Vasilovici
Advanced Installer Team
http://www.advancedinstaller.com/
Octavian Vasilovici - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Shared PDF Printer

Would it not be eaiser to create an installer for the printer only then chain this to the other 2. This way I can control the version of the printer separately from the program's. and also users can choose to uninstall the printer if they want to. I also wouldn't have to worry about the GUID.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Shared PDF Printer

Hello,

If you want to create a separate package for the printer you can add it as a prerequisite on both packages. This way the printer will be installed only if it's not already present on the target machine. You can try using the approach from the Uninstall another MSI when my product is uninstalled how-to, to prompt the user whether to remove the printer prerequisite during any of your product's uninstall or not.

Yet again, referencing your initial post on this thread, to avoid uninstalling the prerequisite if one of your product is installed, you can add a search from the Search page and then include its name in the condition from the above article:

Code: Select all

REMOVE="ALL" AND UNINSTALL_PREREQ="YES" AND YOUR_SEARCH
Each package should search for the other on uninstall and remove the prerequisite accordingly, both having the same prerequisite. Since the user doesn't get a choice if the other product is installed as well, you should condition the user interaction .VBS custom action with:

Code: Select all

YOUR_SEARCH
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Shared PDF Printer

Thanks for your comments Mihai,

The prerequisite option seems to work perfectly in our case. Last question is there a link to your technical documentation that shows when new component GUID's generated. I find it confusing when you save as a template the file extension remains the same so it's very easy to get a project template mixed up with a project and also what effect doing a file "save as". If you're trying to maintain consistent GUID it's difficult to check if they have changed when comparing one aip file to another.

Thanks
Paul

Return to “Common Problems”