Getting parent folder

Got a problem you cannot solve? Try here.
Post Reply
MatDeveloper100
Posts: 10
Joined: Mon Nov 21, 2011 5:45 am

Getting parent folder

Post 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.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting parent folder

Post 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~

Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
MatDeveloper100
Posts: 10
Joined: Mon Nov 21, 2011 5:45 am

Re: Getting parent folder

Post by MatDeveloper100 »

Its working! thanks!
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting parent folder

Post by giaviv »

Great! No problem.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting parent folder

Post by giaviv »

Also, FYI, you can use the MSIcode Extract Path command to achieve the same thing.
Aviv Giladi
InstallAware Software

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