Hi there;
Hoping you can help me. I am trying to figure out how I can determine the location of where a user has installed my primary application. The reason that I need to know this is so that I can install addtional 'add-on' components to the same Installation folder location in which the primary application was originally installed.
Here is an example:
Let's say that I have installed the main application to C:\\Program Files\\MyApp
Now a month later the customer buys an add-on component that enables them to say, burn CD's. I need to place the CD burning add-on component into that same path/location (C:\\Program Files\\MyApp).
The problem of course is that the customer can install the main application anywhere they want so I can't rely on it always being in the default location.
Any help would be greatly appreciated...
Thanks,
Steve
How can I determine the location of a previous installation?
-
- Posts: 11
- Joined: Tue Nov 07, 2006 6:44 am
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Just use Write Registry, if you are working in the MSIcode view. OR, use the Registry view in the visual IDE. Create a new key somewhere in the registry, and record the value $TARGETDIR$.
To read the previous location, you want to use the Read Registry command in your MSIcode script. Find the line where $TARGETDIR$ is initialized (this is usually in the form "Set Variable TARGETDIR...". There, use Check Registry to see if your registry key exists. If it does, read the value and set $TARGETDIR$ to that value; otherwise, just accept the default value of $TARGETDIR$ (do not override).
To read the previous location, you want to use the Read Registry command in your MSIcode script. Find the line where $TARGETDIR$ is initialized (this is usually in the form "Set Variable TARGETDIR...". There, use Check Registry to see if your registry key exists. If it does, read the value and set $TARGETDIR$ to that value; otherwise, just accept the default value of $TARGETDIR$ (do not override).
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Microsoft explains that the need for storing this information is a 'problem of MSI properties not persisting across installations'
http://support.microsoft.com/default.as ... -us;251389
http://support.microsoft.com/default.as ... -us;251389
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
InstallAware lets you persist variables in your setup script across installations - working around this built-in MSI limitation. Just use the Set Variable command with the Persist check-box selected.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 53 guests