How can I get value of HOMEPATH or USERPROFILE:Target Files

Got a problem you cannot solve? Try here.
JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

How can I get value of HOMEPATH or USERPROFILE:Target Files

Postby JohnO » Mon Jul 15, 2013 12:36 am

Firstly, I would like to thank Francesco for his speedy and helpful replies while we were evaluating IA - this had a positive influence on our decision to buy.

On the Files page, I want to place certain folders of reference data in the user's home directory. I can't find any reference to getting hold of this value, or the Windows envt variables HOMEPATH, USERPROFILE. How can I get hold of these values?

I found that MYLOCALAPPDATA resolves to Windows 7's LOCALAPPDATA (BTW, this is not found in F1 Help). This might be acceptable, but it is ignored in XP which doesn't define LOCALAPPDATA (I'd hoped IA might choose the user's home directory instead, but the ref data was not installed).

[Edit: I think maybe $MYPROFILES$ might work? That is not defined in F1 Help, either. I won't have time to try that until later on today.]

Slightly off topic - this is my third attempt to submit this. Twice, I have pressed some key (probably Enter) and my partial post disappeared. The partial post wasn't submitted. I have entered this in an editor first!

Regards, John

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

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby FrancescoT » Mon Jul 15, 2013 10:00 am

Dear John,

Thank you for choosing InstallAware!

which is exactly the target folder you would like to use?

The File Page provides the possibility to define several folders, most of them are those called OS "KNOWNFOLDERS".

You can find more details on these folders at;
http://msdn.microsoft.com/en-us/library ... 94(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library ... 57(v=vs.85).aspx

These folders may have a different location with the different OSes, but in general, these were kept very similar starting from Vista and later OSes.

Example;
LOCALAPPDATA on WIN 7 points to "%USERPROFILE%\Local Settings\Application Data" and on WIN XP to "C:\Documents and Settings\<username>\Local Settings\Application Data".

If you use "System->Profiles directory" ($MYPROFILES$) on WIN 7 points to "%USERPROFILE%" (typical "C:\Users\<UserName>") and on WIN XP "C:\Documents and Settings\<username>".

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

JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby JohnO » Mon Jul 15, 2013 10:44 am

Thanks Francesco
It looks as though you have answered my question.
$MYPROFILES$ will resolve to the same 'home directory' folder as currently used in our product. This has one limitation, in that it is possible for the home directory to be on a network drive, which causes us performance problems and encounters a long-term bug in Java. So, we will discuss the benefits of using LOCALAPPDATA, which will avoid the network drive problem, at the expense of a longer file path if the user needs to access a file directly - most likely the log file.

I will check on my XP machine to see if the 'missing' data is in "C:\Documents and Settings\<username>\Local Settings\Application Data".

Regards, John

JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby JohnO » Tue Jul 16, 2013 12:57 am

Hi Francesco
I have checked on my XP machine and the web install feature defined as being in MYLOCALAPPDATA was not installed anywhere. I did a search of C:\\Documents and Settings\ and the only folder found for its name was in the installer's private cache in "D & S\All Users\Application Data\{XY23......}\".

I'm sure there is another current post to do with data not being installed correctly in XP, when using a segmented web download.

It's possible that there are errors in my installer, as I am discovering how to use IA. This installer is based on the user feedback sample, but with that 'segment' missing from the builder. One result is that the shortcut to the exe doesn't get created. Neither was an entry added to XP's 'Add or Remove Programs', but it was added to W7's 'Programs and Features'.

Is there any info I can provide to help in diagnosing this?

Regards, John

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

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby FrancescoT » Tue Jul 16, 2013 2:03 am

Dear John,

can you post a very minimal project that replicates your issue?
I'll check it.

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

JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby JohnO » Tue Jul 16, 2013 6:41 am

Francesco
Thanks for the offer.
I may have to do something special to get a small project. Eclipse Rich Client apps tend to be large due to all of the eclipse plugins!

Regards, John

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

Re: How can I get value of HOMEPATH or USERPROFILE:Target Fi

Postby FrancescoT » Tue Jul 16, 2013 8:34 am

Dear John,

... you could also create a sample project from scratch, that simply tries to store a dummy file under your desired target folder.

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: Bing [Bot] and 71 guests