Page 1 of 1

Working with environment variables in Path

Posted: Tue Apr 14, 2015 7:49 am
by MarkusHoevermann
Hello,

during the installation process of our application the user has the option to enter a path that is then saved in the registry and used by our application to store data.
During the uninstallation process we want to delete all files from that folder. Therefore we get the value from the registry and store it in a variable.
Then we use "Recursively Delete Files" to clean the folder.

Now we have the following problem: When the user entered a path like %APPDATA%\myapplication the "Recursively Delete Files" does not work. Is there an MSI-code to expand the variable before calling "Recursively Delete Files"?
Or sould the "Recursively Delete Files" work with a path like above and I did something else wrong?

Thanks!

Re: Working with environment variables in Path

Posted: Tue Apr 14, 2015 12:28 pm
by FrancescoT
Dear Markus,

use "Get Environment Variable" to query an Environment variable.

Example;

Code: Select all

Set Variable MY_VAR to
Get Environment Variable %APPDATA% into Variable MY_VAR
MessageBox: , MY_VAR=$MY_VAR$

The same as InstallAware Clipboard data format;

Code: Select all

~InstallAware Clipboard Data~
~MessageBox~
~{A1D7E5FD-D386-4A1A-8156-3B05CBE16AF3}~
~~
~MY_VAR=$MY_VAR$~
~0~
~1~
~~
~Get Environment~
~{9690DB77-2A03-40F7-BC0A-E950381C4762}~
~APPDATA~
~MY_VAR~
~Set Variable~
~{48A6E7D6-7477-4293-9AEB-2C5124121F4B}~
~MY_VAR$MYAH$MYAH$FALSE~
~~


Regards