Page 1 of 1

Getting parent folder

Posted: Mon Nov 21, 2011 5:56 am
by MatDeveloper100
Hi guys,

I can't figure out how to get path to the parent folder using InstallAware.

E.g.
I have

Code: Select all

Set Variable FOLDER_1 to C:\FolderA\FolderB
What I want is just a

Code: Select all

Set Variable FOLDER_2 to C:\FolderA\tmp, using FOLDER_1
So I wrote line:

Code: Select all

Set Variable FOLDER_2 to $FOLDER_1$\..\tmp
But during installation wizard says that it does not understand ".." symbol
Using Set Variable FOLDER_1 to C:\FolderA first, and then adding FolderB is not an option.

Re: Getting parent folder

Posted: Mon Nov 21, 2011 8:34 am
by giaviv
Hi,

You can use the Parse String command with the last occurrence parameter:

Code: Select all

~InstallAware Clipboard Data~
~MessageBox~
~{04422F85-662D-4C5B-B419-BEA24654DEF8}~
~$PATH$~
~~
~0~
~1~
~~
~Parse String~
~{D8C15FB3-E50B-48EA-8108-DACB93F8FFA8}~
~$FILENAME$~
~\~
~PATH~
~FILE~
~1~
~FALSE~
~FALSE~
~Set Variable~
~{54A3E183-DC2E-4AFD-895E-C12C29BC4D45}~
~FILENAME$MYAH$MYAH$FALSE~
~C:\InstallAware\test~


Re: Getting parent folder

Posted: Tue Nov 22, 2011 4:32 am
by MatDeveloper100
Its working! thanks!

Re: Getting parent folder

Posted: Tue Nov 22, 2011 8:07 pm
by giaviv
Great! No problem.

Re: Getting parent folder

Posted: Tue Dec 06, 2011 5:56 pm
by giaviv
Also, FYI, you can use the MSIcode Extract Path command to achieve the same thing.