We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

bwaslo
Posts: 2
Joined: Sun Apr 22, 2007 10:10 pm

How to install to "\Users\Public\"?

I have an app that I need to make installable into all Windows versions from Win2000 through Vista. My App is one in which all users need to have read and write access to the SAME data, stored in a common folder, so any user's changes to these files are evident for (and re-editable by) all other users. The App is to be used in a factory environment for QC testing, where all data or script changes made by any user must to be accessible (the same) by all users, since all workers work on the same job, though in different shifts and with different logons.

This is to be a per-machine installation, installed by an administrator, but usable by all users to manipulate the same data files. Vista appears to make such a thing very difficult to do, it appears to me. From what little I could find on MSN, the "proper" place to store such common-to-all data in Vista seems to be in the "\Users\Public\[appname]" folder. Other places have problems with disallowed access or with the operating system making private versions of files when they get edited. If \Users\Public is the proper location, how do I direct Advanced Installer to do that? I don't see any "Windows Installer folders" that will map to that directory within Vista.

Or is there another place for this common folder to be stored?

I can't be the only one who needs to have his application operate this way!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The folder common to all users is "Common Application Data" folder listed in the "Files and Folders" page. This folder is translated to "C:\ProgramData" on Vista and "C:\Documents and Settings\All Users\Application Data" on XP.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
bwaslo
Posts: 2
Joined: Sun Apr 22, 2007 10:10 pm

Gigi,

Thanks for the fast reply. We can't complain about the attention users get from Caphyon!

I did as you suggested, and in Vista it did install to the "C:\ProgramData\[my application name]" folder as you said. All users can see files there and save to files there.

BUT, when logged in as either an administrator or a non-administrator I'm unable to change and resave any file (just a txt file in my simple test) that had been installed there by Advanced Installer. I get the error message "Cannot create the .... file, make sure the path and filename are correct". When I OK that window, another form pops up for "Save As". But I can't save it to the same name using that dialog, either. I CAN resave a modified file if I change it's filename to something else, but that doesn't help me at all.

I also can't modify any of the files installed into subfolders under that folder. And can't modify any files that other users have stored there, either.

So this doesn't look like "C:\ProgramData\..." will work for me. (Or is there some way I can have AI change permissions to this folder and its subfolders so everyone is able to edit any files that are there?).

In simple manual tests, I have found that if I create and put files into a "C:\Users\Public\[appname]" folder, then anyone is able edit actual files there and resave them. If I could get AI to install to that folder, that would probably work for me. Is there a way to do that, since Windows doesn't have anything that maps to there? I'd even be satisfied if the installer literally just made a \Users\Public\[appname] folder when it needed to install my app into XP.

(I'm getting tempted to just tell my users to avoid Vista altogether! -- I've been fighting this issue for weeks now)

Thanks,
Bill
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Is there a way to do that, since Windows doesn't have anything that maps to there? I'd even be satisfied if the installer literally just made a \Users\Public\[appname] folder when it needed to install my app into XP.
Here is how you can do that:

Define a property in the "Install Parameters" page and name it MY_FOLDER for example. Now switch to "Custom Actions" page and create two "Property Set With Formatted" custom actions under "InstallUISequence->Begin" like this:

1. Property Name: MY_FOLDER
Formatted Text: [CommonAppDataFolder]

2. Property Name: MY_FOLDER
Formatted Text: [WindowsVolume]Users\Public
Execution Condition: VersionNT = 600

First custom action is used if the package is installed on XP and the second is used for VISTA.

Now switch to "Files and Folders" page, create a "New Folder->Property Based" and select the property created above. Add your files into this folder.

Let me know if you encounter any problems.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”