cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
experimenter
Level 4

determine "My Documents" location on Windows

Hello there,

Is it possible to determine "My Documents" location on Windows using IA or I should be writing custom code using DLL from java, for example?

Thanks in advance for your help!
Labels (1)
0 Kudos
(7) Replies
pv7721
Level 20

Quoting from the manual:

Home Directory $USER_HOME$
The home directory of the end user running the installer. For users who have already included the variable $UNIX_USER_HOME$, this variable will continue to function with the same definition as $USER_HOME$.


While I cannot test now for sure, but I think that on Windows that resolves to:
C:\Documents and Settings\Username

so the My Documents if it exists should be $USER_HOME$$/$My Documents
0 Kudos
experimenter
Level 4

pv7721 wrote:
Quoting from the manual:
While I cannot test now for sure, but I think that on Windows that resolves to:
C:\Documents and Settings\Username

so the My Documents if it exists should be $USER_HOME$$/$My Documents

Thank you for your reply!
Well, I thought about this, but My Documents folder can be moved to any location or you are sure that is always under $USER_HOME$?
0 Kudos
pv7721
Level 20

Well, I guess you're right, so you've got at least in the GUI install mode a panel that is called search for files / folder so you can look for it. But then again it can be renamed. Maybe you should prompt the user: where do you want your documents to be saved?
0 Kudos
experimenter
Level 4

pv7721 wrote:
Well, I guess you're right, so you've got at least in the GUI install mode a panel that is called search for files / folder so you can look for it. But then again it can be renamed. Maybe you should prompt the user: where do you want your documents to be saved?

That might be a solution. However, I think it might be the case that for back compatibility issues I need to know the folder without asking, because previous installer was created using InstallAnywhere and all the data was written to a subfolder in My Documents without promting, so it would be nice to do the same. Probably I will have to go for DLL and JNI-like solution.
0 Kudos
pv7721
Level 20

You don't think you can do it in pure Java? (you might want to look at their API that would allow custom code) (all you need to do is to silently find the folder... or you might have this information in the registry and there definitely are some built-in methods to get information from the Windows registry).
0 Kudos
experimenter
Level 4

pv7721 wrote:
You don't think you can do it in pure Java? (you might want to look at their API that would allow custom code) (all you need to do is to silently find the folder... or you might have this information in the registry and there definitely are some built-in methods to get information from the Windows registry).

Yes, searching through registry is another option, actually. Need to find out where it is stored. 🙂
0 Kudos
ChandanOmkar
Level 8

in IS you can achieve this by using PersonalFolder.
0 Kudos