How to change Default TARGETDIR to User Directory?

Got a problem you cannot solve? Try here.
Ristogod
Posts: 15
Joined: Wed May 15, 2013 2:13 pm

How to change Default TARGETDIR to User Directory?

Postby Ristogod » Fri Oct 11, 2013 2:38 pm

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?

Ristogod
Posts: 15
Joined: Wed May 15, 2013 2:13 pm

Re: How to change Default TARGETDIR to User Directory?

Postby Ristogod » Mon Oct 14, 2013 8:25 am

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?

Ristogod
Posts: 15
Joined: Wed May 15, 2013 2:13 pm

Re: How to change Default TARGETDIR to User Directory?

Postby Ristogod » Mon Oct 14, 2013 9:31 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to change Default TARGETDIR to User Directory?

Postby FrancescoT » Mon Oct 14, 2013 11:16 am

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

Ristogod
Posts: 15
Joined: Wed May 15, 2013 2:13 pm

Re: How to change Default TARGETDIR to User Directory?

Postby Ristogod » Wed Oct 16, 2013 10:14 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to change Default TARGETDIR to User Directory?

Postby FrancescoT » Wed Oct 16, 2013 11:57 am

... you could also try with a different user directory instead of My Documents location.

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

Ristogod
Posts: 15
Joined: Wed May 15, 2013 2:13 pm

Re: How to change Default TARGETDIR to User Directory?

Postby Ristogod » Wed Oct 16, 2013 12:15 pm

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: How to change Default TARGETDIR to User Directory?

Postby FrancescoT » Thu Oct 17, 2013 10:55 am

Dear Ristogod,

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

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 77 guests