Working with environment variables in Path

Got a problem you cannot solve? Try here.
Post Reply
MarkusHoevermann
Posts: 1
Joined: Tue Apr 14, 2015 4:27 am

Working with environment variables in Path

Post 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!
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Working with environment variables in Path

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply