Saving variables to use with uninstall.

Got a problem you cannot solve? Try here.
Post Reply
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Saving variables to use with uninstall.

Post by Treoxx »

Is there a possibility to save variables (maybe in the msi file) so I can use them within the uninstall dialogs?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Hi Treoxx!

This capability is not currently available - variables that you need must be saved either in the registry, or in text files, or in some other way you would like to reuse them.

However this was a top feature request, so I am happy to say our development team has added a new "Persist" option to the Set Variable command, which, when checked, automatically saves variable values.

This will be available in an update coming soon!
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Post by Treoxx »

OK Michael thanks!.

Then the next thing:

When I request the variable $TARGETDIR$ in the maintenance dialog I get the following answer:

"C:\\Program files\\$NAMEOFAVARIABLE$"

That was not what I expected.
(Yes I've changed the variable $title$ in the Target Folder by Project Properties.)

Where can I find the right dir from the installed program.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

You will need to get the path from an existing registry entry that you created during the install or search for your application executable.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

TARGETDIR is preserved automatically but I guess setting it to another variable causes this issue.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Post by Treoxx »

@Jimo:

Thats not an option because I use multiple instances.
With different titles, (the user can set the title by himself) but thanks anyway.

@ Michael...

Seems like a bug.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

What happens when you print out the variable with a MessageBox?
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Post by Treoxx »

The first thing I did to see if the variable TARGETDIR exists in the maintenance was to get it by an messagebox.
And there was the "c:\\program files\\$VAR$" message.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

That can only mean that $VAR$ is not defined the second time round. Make sure your script execution path always defines it.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Post by Treoxx »

That would be very weird Michael, I've changed by project properties the target folder to $programfiles$$servicename$ in stead of $programfiles$$title$

It's up to installaware to resolve that variable the right way so it's usable in the maintenance as !text! in the $targetdir$ variable.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I would step through the code line by line in the debugger in maintenance mode to see what is going wrong.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Treoxx
Posts: 24
Joined: Fri Jan 27, 2006 6:29 am

Post by Treoxx »

If I change $TIME$ in another variable lets say $SERVICENAME$
(In project properties, targetdir)

The value of $SERVICENAME$ is 12345

Because I'm making an installer for multiple instances the user has to choose the title for the software. This is written in $SERVICENAME$

The user changes it to 54321.

He finished the installation, and goes to uninstallation..

Messagebox with $TARGETDIR$ "C\\programfiles\\\"


Well.... I give up :) will wait at the option for variables for install and maintenance, I really need it, not only for the targetdir.
Post Reply