I've got a game application that I'm trying to write an installer for. The game is an online game that has its own launcher/patcher and will need to apply frequent updates. Because of this, its desirable to install to a folder that doesn't require elevation to write to (otherwise the launcher/patcher would constantly have to request elevation to run)
Other applications in this situation have modified the traditional PerUser/AllUsers install paths to be:
* AllUsers = install to a common per-machine location (e.g., CSIDL_COMMON_APPDATA)
* PerUser = install to something like CSIDL_LOCAL_APPDATA
Microsoft even specifically addresses the problems posed by patching software here:
My preference would be to install to a location like:
This seems to be fairly irritating to implement. For starters, I haven't been able to get NSIS to reliably get me either the user's 'My Documents' folder or the 'Common' folder. I can get CSIDL_COMMON_APPDATA with something liek this:
The SHGetSpecialFolderPath doesn't seem to work with the 'My Documents' folder. When I passin the CSIDL for that (12) - I get nothing... I can get it from the registry using
Finally - uninstallation can also be tricky. If a user installs (without privileges) in an AllUsers context to a folder like C:\Users\Public\ traditional installation/uninstallation tricks like writing registry keys/values to HKLM might not be available.
Does anybody have any experience with the kind of installer I'm talking about? I would really appreciate hearing from anybody who has been down this path before.
Other applications in this situation have modified the traditional PerUser/AllUsers install paths to be:
* AllUsers = install to a common per-machine location (e.g., CSIDL_COMMON_APPDATA)
* PerUser = install to something like CSIDL_LOCAL_APPDATA
Microsoft even specifically addresses the problems posed by patching software here:
My preference would be to install to a location like:
- AllUsers
- Vista/Win7: C:\Users\Public\Games\
- XP: C:\Program Files\
- PerUser: C:\<profile>\My Documents\My Games\
This seems to be fairly irritating to implement. For starters, I haven't been able to get NSIS to reliably get me either the user's 'My Documents' folder or the 'Common' folder. I can get CSIDL_COMMON_APPDATA with something liek this:
But that doesn't actually give me the path I want. It might *work*, but it's not optimal.code:
System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i 46, i0)i.r0'
The SHGetSpecialFolderPath doesn't seem to work with the 'My Documents' folder. When I passin the CSIDL for that (12) - I get nothing... I can get it from the registry using
But I've heard that the registry method may not be reliable in non-English Windows installations (I haven't verified that).code:
ReadRegStr $0 HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" Personal
Finally - uninstallation can also be tricky. If a user installs (without privileges) in an AllUsers context to a folder like C:\Users\Public\ traditional installation/uninstallation tricks like writing registry keys/values to HKLM might not be available.
Does anybody have any experience with the kind of installer I'm talking about? I would really appreciate hearing from anybody who has been down this path before.
Comment