cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ChrisA
Level 3

Predefined Folders w/ Installscript proj??

I have two Installscript projects. I need to add a file to the user's "My Documents" folder. When I right-click "Destination Computer" to select "Show Predefined Folders" it is grayed out.

Are "Predefined Folders" not available for Installscript projects? If they are available, what would cause the graying out? If not available in Installscript projects, what's the best way to get something into "My Documents"??

-- Thanks
Labels (1)
0 Kudos
(3) Replies
MarkEarle
Level 6

Chris,

If the predefined variables are not available you can get to "My Documents" by querying the environment variable USERPROFILE and append "My Documents" to the returned path.

if( GetEnvVar( "USERPROFILE", svProfilePath ) < 0 ) then
Sprintf( svMsg, @MSG_FIND_ENVVAR_FAIL, "USERPROFILE" );
MessageBox( svMsg, SEVERE );
abort;
else
svDocPath = svProfilePath ^ "My Documents";
endif;


This will work for English systems only. You will have to get "My Documents" translated for globalized installations.

Cheers,

ME
0 Kudos
ChrisA
Level 3

ME,
I think it's possible for My Docs to be somewhere besides under UserProfile (though I'm not sure). But I also have to deal with different languages. I guess I need to try to call into the ShFolder dll.

I was hoping someone might explain why InstallShield doesn't show "Predefined Folders" for Installscript projects.

Thanks - Chris
0 Kudos
MarkEarle
Level 6

Chris,

You are correct, My Documents can be anywhere. I don't know why predefined shell folders are not shown in InstallScript projects however you can find them in the registry easy enough without any issues with OS language. They are located at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders.

The variable Personal contains the path to My Documents.

Hope someone from Macrovision can answer your question.

Cheers,

ME
0 Kudos