Page 1 of 1

How to change Default TARGETDIR to User Directory?

Posted: Fri Oct 11, 2013 2:38 pm
by Ristogod
By default InstallAware seems to make the TARGETDIR be $PROGRAMFILES$\$TITLE$. I would like to change it so that it goes to the user's user directory instead. An example would be "C:\Users\risto" I can't seem to find a per user variable that locates to this. I can find the MyDocuments though. But I don't want to install into My Documents. Any thoughts?

Re: How to change Default TARGETDIR to User Directory?

Posted: Mon Oct 14, 2013 8:25 am
by Ristogod
I did some searching online for different windows environment variables. HOMEPATH seems to work within windows. Is there an equivalent variable in InstallAware? Or can I use Windows Environment variables somehow?

Re: How to change Default TARGETDIR to User Directory?

Posted: Mon Oct 14, 2013 9:31 am
by Ristogod
Nope. I tried using %HOMEPATH% and it still wants to always go to the C:\Users\Username\Desktop folder. I don't want to install to the desktop by default. There has to be a way to get the intended location.

Re: How to change Default TARGETDIR to User Directory?

Posted: Mon Oct 14, 2013 11:16 am
by FrancescoT
Dear Ristogod,

try the following;

Code: Select all

Set Variable MY_PATH to 
Set Variable MY_USER to 
Get Folder Location My->My Documents into MY_PATH
Get System Setting Logged on User Name into MY_USER
Parse String $MY_PATH$ into Variables MY_PATH and  (Split at first occurrence of pattern)
Set Variable MY_PATH to $MY_PATH$$MY_USER$
The same ... as InstallAware Clipboard format;

Code: Select all

~InstallAware Clipboard Data~
~Set Variable~
~{8C541835-DFAD-40A3-AE7D-6994A53895FC}~
~MY_PATH$MYAH$MYAH$FALSE~
~$MY_PATH$$MY_USER$~
~Parse String~
~{9BE12017-5804-4F21-9DAD-BC22FCF0AE0E}~
~$MY_PATH$~
~$MY_USER$~
~MY_PATH~
~~
~0~
~FALSE~
~FALSE~
~Get System Settings~
~{6709E92F-AE04-4C43-88D9-CF944DE9C251}~
~MY_USER~
~60~
~Get Folder Location~
~{239D7695-A926-49BB-8E94-0A628E9F1B3F}~
~MY_PATH~
~2~
~FALSE~
~Set Variable~
~{BF34AE3F-993B-4E53-82A3-923FCDFC7F3C}~
~MY_USER$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{CB12FC90-1243-40DD-A041-7E8E19618BD9}~
~MY_PATH$MYAH$MYAH$FALSE~
~~
Regards

Re: How to change Default TARGETDIR to User Directory?

Posted: Wed Oct 16, 2013 10:14 am
by Ristogod
Thanks for the help. I tried that. It does not seem to work.

One thing that might be affecting this is that the My Documents location on the machines is mapped to a network location.

Re: How to change Default TARGETDIR to User Directory?

Posted: Wed Oct 16, 2013 11:57 am
by FrancescoT
... you could also try with a different user directory instead of My Documents location.

Regards

Re: How to change Default TARGETDIR to User Directory?

Posted: Wed Oct 16, 2013 12:15 pm
by Ristogod
I think I figured it out. Not sure how I didn't see this before, but I did this and it's giving me the result I want.

Code: Select all

Get Folder Location System->Profiles Directory into PROFILESDIR
  Set Variable TARGETDIR to $PROFILESDIR$\$TITLE$

Code: Select all

~InstallAware Clipboard Data~
~Get Folder Location~
~{52124D7F-F719-43C2-ACC6-E87AF1D0172C}~
~PROFILESDIR~
~19~
~FALSE~
~InstallAware Clipboard Data~
~Set Variable~
~{49FB1070-8740-4288-8DDB-4D116705D1D9}~
~TARGETDIR$MYAH$MYAH$FALSE~
~$PROFILESDIR$\$TITLE$~
Thanks again for trying to help. I appreciate it.

Re: How to change Default TARGETDIR to User Directory?

Posted: Thu Oct 17, 2013 10:55 am
by FrancescoT
Dear Ristogod,

the funny thing is ... that I missed as well.
You are right, that is the one to use.

Regards