Page 1 of 1

Saving variables to use with uninstall.

Posted: Fri Apr 07, 2006 8:50 am
by Treoxx
Is there a possibility to save variables (maybe in the msi file) so I can use them within the uninstall dialogs?

Posted: Fri Apr 07, 2006 10:30 am
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!

Posted: Wed Apr 26, 2006 9:55 am
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.

Posted: Wed Apr 26, 2006 10:54 am
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.

Posted: Wed Apr 26, 2006 2:32 pm
by MichaelNesmith
TARGETDIR is preserved automatically but I guess setting it to another variable causes this issue.

Posted: Thu Apr 27, 2006 5:08 am
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.

Posted: Thu Apr 27, 2006 7:48 am
by MichaelNesmith
What happens when you print out the variable with a MessageBox?

Posted: Fri Apr 28, 2006 4:44 am
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.

Posted: Sat Apr 29, 2006 2:21 pm
by MichaelNesmith
That can only mean that $VAR$ is not defined the second time round. Make sure your script execution path always defines it.

Posted: Mon May 15, 2006 8:15 am
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.

Posted: Mon May 15, 2006 3:06 pm
by MichaelNesmith
I would step through the code line by line in the debugger in maintenance mode to see what is going wrong.

Posted: Thu May 18, 2006 5:12 am
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.