-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install to ProgramData when LocalAppData is broken #308
Conversation
…n't hardcode to LocalAppData
if (!useFallbackDir) { | ||
SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, targetDir); | ||
} else { | ||
ExpandEnvironmentStrings(L"%HOMEDRIVE%\\ProgramData", targetDir, _countof(targetDir)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just CSIDL_COMMON_APPDATA
? (Older versions use C:\Documents and Settings\All Users\Application Data).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a better idea
Are there any issues filed describing any of these "dizzying array of reasons"? I'd like to understand this better before committing to a local user install approach. |
Strangely enough, none of these issues are filed on Squirrel - I suspect that Squirrel hasn't gotten enough Traction In The Enterprise(tm) yet, but we definitely see it on Atom and in the Slack Windows app. Apparently a lot of IT shops have followed the steps in http://www.computerworld.com/article/2485214/microsoft-windows/cryptolocker-how-to-avoid-getting-infected-and-what-to-do-if-you-are.html which ends up blocking anything in AppData. Others have completely borked permissions on AppData because Security(tm), or crappy Antivirus goes insane and blocks anyone executing in AppData |
...wow. This sounds like it's going to need to evolve into a "your company fucked up permissions, where would you like to install?" dialog, ultimately. |
Well, so this PR does mostly set us up to run anywhere, including (vomits in mouth) Program Files. After this PR, all we need to do is detect when we need to elevate and rerun ourselves. |
Sadly, I work at an Enterprise(tm) place and yep, our Group Policy blocks executables in |
Install to ProgramData when LocalAppData is broken
For a dizzying array of reasons, installing anything to
%LocalAppData%
simply doesn't work, or throws bizarre errors. It turns out though, that since nobody knows what the hell to do withC:\ProgramData
, nobody looks there either. When installations fail to%LocalAppData%
, we're gonna fall back toC:\ProgramData\$PackageName
. On Windows 7 whereC:\ProgramData
doesn't exist, we'll just make it.This PR also adds an
IsInstalledApp
property on UpdateManager which lets you tell if the application is currently installed.Pay Attention To This!
If your application currently is hard-coded to look in
%LocalAppData%
for stuff, this PR will break you (well technically, these users were never able to install in the first place, but now they will be able to and now you're gonna see weirdness). Instead, use UpdateManager'sRootAppDirectory
property, or do all of your operations relative toAssembly.GetExecutingAssembly().Location
.TODO