How can I determine the location of a previous installation?

Got a problem you cannot solve? Try here.
Steve
Posts: 118
Joined: Fri Jun 16, 2006 9:51 pm
Location: Canada eh

How can I determine the location of a previous installation?

Postby Steve » Tue Nov 07, 2006 11:05 am

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

muddasirqdiwai
Posts: 11
Joined: Tue Nov 07, 2006 6:44 am

Postby muddasirqdiwai » Wed Nov 08, 2006 6:34 am

hi try to create a registry where u save $TARGETDIR$ and when u run installer again just read it from same registry

Steve
Posts: 118
Joined: Fri Jun 16, 2006 9:51 pm
Location: Canada eh

Postby Steve » Thu Nov 09, 2006 3:20 pm

Thanks very much for the reply.
I figured that I would need to save that info to a ini or registry entry, however my problem is that being a newbie, I really don't understand the process involved in doing that within InstallAware.

Can anyone provide some additional details on how to do this?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Nov 11, 2006 3:29 pm

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).
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Steve
Posts: 118
Joined: Fri Jun 16, 2006 9:51 pm
Location: Canada eh

Postby Steve » Sun Nov 12, 2006 5:35 pm

That works great!
Thanks very much Michael.

mberterm
Posts: 5
Joined: Mon Nov 27, 2006 3:47 pm

Postby mberterm » Mon Nov 27, 2006 4:59 pm

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

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Nov 27, 2006 5:33 pm

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/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 49 guests