Install addin for different versions of Excel - Advanced Installer Community
Zeroeffect
Posts: 5
Joined: Wed Jul 08, 2015 3:56 pm

Install addin for different versions of Excel

Hi,

I'm trying to create an installer for an Excel addin.
I want the installer to detect which Excel version is used and then install the addin accordingly.

I have created a Custom Action in C# that finds out which Excel version is installed.
The custom action then stores the Excel version in a variable called EXCEL_VERSION.

Example code from the Custom Action:

Code: Select all

session["EXCEL_VERSION"] = "2013";
I can then display a dialog box in AI, showing which Excel version is installed (And it works!)

Code: Select all

Excel Version: [EXCEL_VERSION]
I have then created a number of registry entries, one for each version of Excel.
Using the "Go to Component", I have set a condition for each registry entry and this is where it doesn't work.
The conditions never seems to evaluate to True...

Condition:

Code: Select all

EXCEL_VERSION= "2013"
Any input on this would be very much appreciated!

I have one additional question regarding the variable [AI_ADDIN]
How can I find out if the "Office Product Addin" is used in my project?

Many thanks,
Kalle
ai.png
ai.png (136.76 KiB) Viewed 3660 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install addin for different versions of Excel

Hello Kalle,

This may happen if your C# custom action is not scheduled before the "Install Execution Stage -> Preparing -> InstallValidate" standard action. If this is not the case then please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

If this still doesn't works, then I recommend you create a separate MSI installation setup for each Excel version targeted by your addin and then create a main wrapper setup project in which you add all the above MSIs as feature-based prerequisites. Then, you can add your C# custom action into your wrapper setup project and use the "EXCEL_VERSION" property to condition the installation of the features assigned to each feature-based prerequisite.
I have one additional question regarding the variable [AI_ADDIN]
How can I find out if the "Office Product Addin" is used in my project?
You can search in "Table Editor" page -> "Custom Actions" table for an"AI_SearchOfficeAddins" custom action. If such custom action is present it means our Office Addin Wizard was used to add and include an addin into the current project. However, please note that there could still be the case when an addin is included into a project using our Office Addin Wizard, but no such custom action is added into your project. This depends on how your adding installation settings were configured. In this case there is no flag which you can search for in your project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Zeroeffect
Posts: 5
Joined: Wed Jul 08, 2015 3:56 pm

Re: Install addin for different versions of Excel

Thanks Daniel,

I have checked the log file and from what I can see, the custom action gets loaded before "Install Execution Stage -> Preparing -> InstallValidate".

I have sent you an e-mail with the .AIP file and the verbose log.

Many thanks,
Kalle
Zeroeffect
Posts: 5
Joined: Wed Jul 08, 2015 3:56 pm

Re: Install addin for different versions of Excel

Hi again!

I found the problem!

I thought it would be enough to call the Custom Action in the “Wizards Dialog State” and that the variables then would be available in the “Install Execution Stage”, but then I realized that I need to call the Custom Action in the "Install Execution Stage" as well.

Many thanks for your support!

Cheers,
Kalle
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install addin for different versions of Excel

You're always welcome Kalle.

If you want to share your project solution with our users please feel free to attach your project resources here and add a short description for the main settings. This will certainly be useful for future users.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”