Using target folders in variables

Got a problem you cannot solve? Try here.
Post Reply
sol952
Posts: 24
Joined: Thu Apr 21, 2016 9:20 am

Using target folders in variables

Post by sol952 »

Are you not allowed to use target folders when setting other variables? I have the block below

Code: Select all

     Create Folder $COMMONAPPDATAFOLDER$\foo\bar\Archive\temp
     Set Variable TempPath to $COMMONAPPDATAFOLDER$\foo\bar\workspace
     Set Variable ZipPath to $COMMONAPPDATAFOLDER$\foo\bar\Archive\Pre($TITLE$.1)\workspace.zip
     MessageBox: , $TempPath$ $ZipPath$ $COMMONAPPDATAFOLDER$
In the first line the folder is created in the expected location but when I set the variables in the next two lines they show up in the message box with $COMMONAPPDATAFOLDER$ to start instead of the value that should replace it. I have this block near the beginning of my projects main msicode script.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Using target folders in variables

Post by FrancescoT »

Dear Sol952,

the "Create Folder" command is a "Windows Installer Command" (PURPLE COMMANDS), due of this the command doesn't get executed immediately (...before the "MessageBox" statement) but instead, its effective execution is deferred to "Apply Install" execution.
http://www.installaware.com/forums/view ... f=2&t=4338

That said;

- Are you sure that your COMMONAPPDATAFOLDER variable gets initialized before the "MessageBox" statement?

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
sol952
Posts: 24
Joined: Thu Apr 21, 2016 9:20 am

Re: Using target folders in variables

Post by sol952 »

Ah. Ok that's why the create folder was working with that variable but the set variable wasn't. Thank you
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Using target folders in variables

Post by FrancescoT »

:D
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