cancel
Showing results for 
Search instead for 
Did you mean: 
RobSzy
Flexera beginner

Setting files and folder destination to a custom/own path variable

Hello to everyone,

after days and days I'm frustrated in creating a custom destination for my "files and folders".

The point is, that I want to install some files in C:\users\public\documents\... because they need to be accessable and writable for all users. First I used the predefinied folder [ALLUSERSPROFILE] but this solution doesn't work solid. Under Win 7/8 it works perfectly, but under Win 10 the return path is C:\ProgramData\ and not C:\users\public\....

So I've created a own "path variable" called "MYALLUSERSDOC" from type registry where i read the "allusersdocuments" from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Documents. Now I want to use this path variable in my "files and folder" destinations but i don't know how :-( I tried to create a new folder, in the properties I set the target to "[MYALLUSERSDOC]" but the result is a new folder named "MYALLUSERSDOC", not "C:\users\public\...".

What is my mistake? How can I use a own path variable for folder destination?

Thank you very much for help! I'm getting more and more frustrated...

Robert
Labels (1)
0 Kudos
4 Replies
MarkusLatz
Active participant

Re: Setting files and folder destination to a custom/own path variable

If I assume that your project is basic msi, then define a "system search" for "Folder path, as specified by a registry entry", use your registry path and key and store in i.e. in MYALLUSERSDOC and use for your component.

Just follow the "system search" wizard in InstallShield.

regards

Markus
0 Kudos
RobSzy
Flexera beginner

[solved]

Good Morning Markus,

sorry, I forgot to mention it, yes it is a basic msi project Smiley Happy

Your solution works perfectly, I didn't think it would be so easy. Thank you very much! Smiley Happy

Best regards,

Robert
0 Kudos
Highlighted
MarkusLatz
Active participant

Re: Setting files and folder destination to a custom/own path variable

So next time, try to use forum earlier ;-)

regards

Markus
0 Kudos
Not applicable

Re: Setting files and folder destination to a custom/own path variable

Try adding a "New Set Directory" custom action:

Directory Name = MYALLUSERSDOC
Directory Value = [REGISTRY_ENTRY_MYALLUSERSDOC]

schedule it after CostFinalize
0 Kudos