Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a folder under %allusersprofile% during Setup with VS 2003 Setup Project?

I need to create a folder under "%allusersprofile%/Program Data" during the install process.

The Setup file is created with VS 2003 setup project, and in it you can use several Known Folders... but as I see none maps to %allusersprofile% or "%allusersprofile%/Program Data".

I thought that creating a "Custom Folder" (within VS Setup Project) and setting the TargetLocation as %allusersprofile% it would work, but during install it says that I don't have permission to that folder (and I do have).

Do you know how to target that folder in VS Setup Project?

Also... I'm working in Windows XP, so %allusersprofile% maps to "C:\Documents and Settings\All Users", but there I suppose I should create my folder inside the "Program Data" folder.

In Vista, %allusersprofile% maps to "C:\ProgramData" and it look correct if I create my folder directly there.

Any idea how to target both OSs?

Additional info: I'm trying this to avoid the new security features in Vista, where the app can't write files under the Program Files folder when running as a common user at least. So I need to place the writable files on "common" folder that is not in a "per user" basis.

like image 975
Romias Avatar asked Nov 24 '25 06:11

Romias


1 Answers

Problem solved... In VS Setup Project you can create a folder saying that the DefaultLocation is: [CommonAppDataFolder]\[ProductName]

That works fine in MS Vista and in XP

like image 126
Romias Avatar answered Nov 27 '25 23:11

Romias



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!