m309810
Posts: 4
Joined: Thu Sep 11, 2008 8:27 pm

Conditional Shortcut installation

I have what I think is a very simple problem, but can't find any way to deal with it.

We are using the product (professional) to distribute a Microsoft Access database. The installer copies the mdb to a folder in "My Documents" and puts a shortcut on the desktop. In its simplest form, this is no problem.

We would like to have two different shortcuts in the package and only install one of them, dependent upon the windows version. The shortcuts' targets actually point to the version of MS Access that is appropriate to the Windows version. The shortcut argument points to the mdb that is distributed. This is to prevent opening the mdb with an inappropriate version of MS Access (Access 97 exists on the Win2K machines and will break the database file, so we need to prevent opening with that program).

So, if versionNT = Win2K, install the MS Access 2000 shortcut on the desktop and if WinXP, install the MS Access 2003 shortcut on the desktop.

How would I do that?

Thanks,

Wayne
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional Shortcut installation

Hi Wayne,
We would like to have two different shortcuts in the package and only install one of them, dependent upon the windows version.
This can be done by conditioning the components of the two shortcuts with the VersionNT property. For more details about this please see the Install resources based on the OS version how-to in the User Guide.

A shortcut to an installed file cannot have its own component and it is added automatically to the component of its target. Therefore you first need to create shortcuts to an external file instead of shortcuts to an installed file. This type of shortcuts can be moved to any component in the Organization page.

Since an external shortcut cannot have a component of its own, you can create two dummy components by using registry values in the Registry. For example, you can use one registry value for one shortcut and another value for the other shortcut. The components of these values can be conditioned with the "VersionNT" property and they can contain the two shortcuts.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
m309810
Posts: 4
Joined: Thu Sep 11, 2008 8:27 pm

Re: Conditional Shortcut installation

Cosmin,

Thank you. That got me as far as a successful build with the two conditioned shortcuts in the project. The problem now is that while the installation appears to run successfully, neither shortcut is installed. One has the condition versionNT=500 and the other has the condition versionNT>500. Any ideas on why that is so? Is there a log that I can turn on and review to see what might have gone wrong?

Regards,

Wayne
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional Shortcut installation

Hi Wayne,

Please note that a shortcut to an external file is not created if its target doesn't exist. Can you please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it?

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

Return to “Common Problems”