Page 1 of 1

Parent of TARGETDIR

Posted: Thu Feb 03, 2011 9:32 am
by oscar_trashcan
I have a base install that has applications and various controls incorporated whoose TARGETDIR defaults to $ProgramFiles$\Norwel32 but this is not necessarily used. I have a further install whoose TARGETDIR defaults to $ProgramFiles$\Norwel32\PrescientPLUS but this install now also has a later version of a registered control that forms part of the first install. As I cannot be certain of what the TARGETDIR are is it possible to determine what the parent of the further install is to overwrite and re-register the updated control? :?

Re: Parent of TARGETDIR

Posted: Fri Feb 04, 2011 5:10 pm
by giaviv
Dear oscar_trashcan,

Potentially, you could use Parse String in order to split your TARGETDIR by the last occurrence of "\", twice.
Note that the TARGETDIR is specified as so: C:\Program Files\Target\. In other words, there is an extra slash at the end. Therefore, we need to split the string twice.
To do so, create a Parse String command. In the String field, type $TARGETDIR$. In the Pattern or Position field, type \. Insert the result into a variable of your choice and insert that variable's name (lets call it TARGETDIRNOSLASH) into the Variable for First Part field. Don't forget to select "Split at last occurrence of the pattern" in the Operation combobox. Now, TARGETDIRNOSLASH will have the value C:\Program Files\Target.
Now, lets create another Parse String command with the exact same parameters (you can copy paste the previous command), except the String field which will now have $TARGETDIRNOSLASH$ and the Variable for First Part which will now have the PARENTDIR variable (or a different name of your choice). After running the second command, PARENTDIR will have the value C:\Program Files\.

Re: Parent of TARGETDIR

Posted: Tue Feb 08, 2011 7:12 am
by oscar_trashcan
Thanks - following the below that worked a treat - regards
oscar_trashcan
:D

Then in the Files upperpane select the folder that you want to select the file(s) you want then 'Add Folder' to pickup the updated file as a subfolder of say $TARGETDIR$ then (right click)Edit the new folder to be $PARENTDIR$ checking the boxes as appropriate.

Re: Parent of TARGETDIR

Posted: Tue Feb 08, 2011 12:08 pm
by giaviv
Great! Glad to help.