Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Best or recommended practice


3 replies to this topic

cbockem

cbockem
  • Full Members
  • 2 posts

Posted 23 March 2007 - 11:18

Until recently we used to package our software so that the default installation looked as follows:

QUOTE

Program Files\<Company>\<Program>\binaries and help...
Program Files\<Company>\<Program>\<Examples>\example data...
Program Files\<Company>\<Program>\<Data>\user model data...


With "Program Files" of course coded as [ProgramFilesFolder].

Now more and more of our customers have switched to a Windows setup with a "normal user" and an "admin user" where only the latter is able to install software. Together with that, read/write access to any directory below "Program Files"... is not allowed any more to the "normal user".

With the recommended location for the data now being somewhere within the "My Documents" hierarchy (...always these stupid childish "My..." - "My..." - "My..." folder names - but ok...). But this doesn't work during installation, because if I put the examples and user data into that directory, only the admin will be able to see them afterwards!

So to me it looks like the "recommended location" should be somewhere below

QUOTE

...\Documents and Settings\All Users\Shared Documents


But as far as I could find out there is no accepted "code" (like the one above) for that folder! I only found the following:

QUOTE

[CommonAppDataFolder]


and we are using it now. But this is everything but an ideal solution, because people are having difficulties finding it - which is no miracle: It is "hidden" by default! So I had to make provisions (shortcuts...) so the users could really find it.

But I am still unable to believe that this probably VERY COMMON case ("user" and "admin" accounts, program that comes WITH data and examples...) has really no clean, user friendly and "recommended" solution!!

How would you all solve that problem of putting program data to a defined and reachable location on all installations?


Thanks for all helpful hints!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 March 2007 - 18:05

Unfortunately Windows Installer appaears to be moving away from provising predefined properties for such directories and instead recommends calling Windows API function to get the locations.

BTW placing user files under the Program Files folder has never been good practice, and on Vista this is enforced by UAC.

cbockem

cbockem
  • Full Members
  • 2 posts

Posted 26 March 2007 - 09:00

Thanks for the reply so far, but I'm afraid that I am not there yet! And I would normally assume that such a "simple" question should be of general interest - or is there nobody else trying to comply to "Microsoft good practise standards" (whatever that is...)?

I know that placing data under Program Files was never good practise, but I "inherited" that from my predecessor.

But my problem is now exactly:

- Where else should I put the data ("documents") in order to comply with "good practise" rules that are followed by Microsoft? As far as I understand currently, this would have to be the Shared Documents folder.

and

- How to tell it to the Microsoft Installer? To that question I did not find an answer yet!

If "calling Windows API function" is the option, which ones should be called then? (Ok, the next question would be how to tell that to MSI, but once I see the direction, I could possibly solve that one...). Just guessing and trying is NO option in my case, because our software will be installed on systems throughout the world, from Windows 2000 to XP and possibly soon also Vista, so any solution we provide should work on these three systems on any language version (even though the software itself is always in english)!

After getting there, the only and probably unanswerable question remains: Why does Microsoft make it so difficult to follow their "good practise" concepts? Don't they believe in them??

Btw, is there any public forum directly on a Microsoft site where I could also ask that question once? Because I would really very much like to hear an answer from a "Microsoft professional" about that silly question!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 March 2007 - 15:42

The API function is called SHGetKnownFolderPath.
You could try the newsgroup microsoft.public.platformsdk.msi