determining version of PIA to install based on Office ver - 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!

andersent
Posts: 7
Joined: Sun Sep 12, 2010 3:52 am

determining version of PIA to install based on Office ver

How would I accomplish the following?

Deploy office 2003 pia as a prerequisite if and only if 2003 office is installed on this machine and no other versions of Office are installed (since I assume 2003 may be found depending on how we search the registry if 2003 was previously installed but now 2007 or 2010 are in use) and the 2003 pia are not already installed (I can figure out how to do this latter part by the built in 2003 pia program code check but not sure about the other two).

Deploy office 2007 pia as a prerequisiste if and only if 2007 office is installed (and the active version) on this machine and not other versions of Office are installed and the 2007 pia is not already installed...

Deploy office 2010 pia as a prerequisiste if and only if 2010 office is installed (and the active version) on this machine and not other versions of Office are installed and the 2010pia is not already installed...
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: determining version of PIA to install based on Office ver

Hello,

The desired behavior can be achieved by creating searches on the Prerequisites' install conditions tab.
You can detect whether PIA is installed by searching the registry for specific keys/values (you will have to research what are these keys/values).
You will have per total three prerequisites (one for each version of PIA) with their install conditions properly set.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
andersent
Posts: 7
Joined: Sun Sep 12, 2010 3:52 am

Re: determining version of PIA to install based on Office ver

This only partially answers the question. I realize that I can do a search for whether the PIA for each version already exists (and in fact, this seems to already be predefined when you choose to add "2003 PIA" or "2007 PIA" as one of the preset prerequisites. It searches for a product code. But, what I'm not sure how to do is also search for what version of Office is current and in use on the machine and deploy the correct PIA. I can't have it just search to see if the 2003 PIA is not there and then try to install it if it is not found when this is a 2007 or 2010 office machine. So really, what I'm asking for here, is how to carefully detect the current version of Office on this machine. I've searched your forums and the web in general and it seems there are some ideas on this but perhaps no clear consensus. I'm concerned that if I choose to search on a registry key or value that works for 90% of machines but doesn't for others (such as a case where perhaps 2003 and 2007 are both installed but 2007 is current since that scenario is possible, at least for excel and word) then my installer may start to deploy the wrong PIA to a machine (and I'm not even sure what the ramifications are of that).
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: determining version of PIA to install based on Office ver

Hello,

Please note that the Install Conditions tab can hold multiple searches. For example, the 2010 PIA prerequisite's install conditions' logic might be something like:
- registry key for 2010 does not exist
- registry key for PIA 2010 exists
- "Install if all of the above searches fail" checked.

Similarly, 2007 PIA prerequisite:
- registry key for 2007 does not exist exist
- registry key for PIA 2007 exists
- registry key for 2010 exists
- "Install if all of the above searches fail" checked.

And finally 2003 PIA prerequisite:
- registry key for Office 2003 does not exist exist
- registry key for PIA 2003 exists
- registry key for Office 2007 exists
- registry key for Office 2010 exists
- "Install if all of the above searches fail" checked.

A configuration like that will:
- only install 2003 PIA if Office 2003 is installed and 2007 or 2010 are not installed.
- only install 2007 PIA if Office 2007 is installed and Office 2010 is not installed
- only install 2010 PIA if Office 2010 is installed.

I am assuming that by "office version in use" you mean the latest version installed on the system.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
andersent
Posts: 7
Joined: Sun Sep 12, 2010 3:52 am

Re: determining version of PIA to install based on Office ver

Great, thank you for the answer and the details Gabriel. I did not think of using both registry key value found and reg key not found--I was actually a little confused on how those work, in conjunction with the overall setting that says install if all of the above searches fail. So my only final question with regard to this issue, then, is what is the best way to check for any of these versions of office? The registry, or a product code? And if the registry what is the surest way?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: determining version of PIA to install based on Office ver

Hello,

There is no right way when trying to detect whether a product is installed or not. For example, Office's installer is Windows Installer based, so searching for the product code should be accurate. Other products' installers might not have a product code so searching for a registry key/value to identify them would be more appropriate in that case.
Also, when searching by registry, you should test your installer on different operating systems and system architectures. The software you are trying to detect might install different registry keys based on the platform it is installed on.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”