{"action":"created","comment":{"url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/comments/28381046","id":28381046,"diff_hunk":"@@ -137,13 +137,34 @@ int CUpdateRunner::ExtractUpdaterAndRun(wchar_t* lpCommandLine)\n \twchar_t logFile[MAX_PATH];\n \tstd::vector<CString> to_delete;\n \n-\tSHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, targetDir);\n+\tif (!useFallbackDir) {\n+\t\tSHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, targetDir);\n+\t} else {\n+\t\tExpandEnvironmentStrings(L\"%HOMEDRIVE%\\\\ProgramData\", targetDir, _countof(targetDir));","path":"src/Setup/UpdateRunner.cpp","position":17,"original_position":17,"commit_id":"ce59c169ef759e22cda3c6523b2f5c6756c339cb","original_commit_id":"ce59c169ef759e22cda3c6523b2f5c6756c339cb","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"body":"Probably a better idea","created_at":"2015-04-14T23:20:09Z","updated_at":"2015-04-14T23:20:09Z","html_url":"https://github.com/Squirrel/Squirrel.Windows/pull/308#discussion_r28381046","pull_request_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308","_links":{"self":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/comments/28381046"},"html":{"href":"https://github.com/Squirrel/Squirrel.Windows/pull/308#discussion_r28381046"},"pull_request":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308"}}},"pull_request":{"url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308","id":33306960,"html_url":"https://github.com/Squirrel/Squirrel.Windows/pull/308","diff_url":"https://github.com/Squirrel/Squirrel.Windows/pull/308.diff","patch_url":"https://github.com/Squirrel/Squirrel.Windows/pull/308.patch","issue_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/308","number":308,"state":"open","locked":false,"title":"Install to ProgramData when LocalAppData is broken","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"body":"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 with `C:\\ProgramData`, nobody looks there either. When installations fail to `%LocalAppData%`, we're gonna fall back to `C:\\ProgramData\\$PackageName`. On Windows 7 where `C:\\ProgramData` doesn't exist, we'll just make it.\r\n\r\nThis PR also adds an `IsInstalledApp` property on UpdateManager which lets you tell if the application is currently installed.\r\n\r\n## Pay Attention To This!\r\n\r\nIf 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's `RootAppDirectory` property, or do all of your operations relative to `Assembly.GetExecutingAssembly().Location`.\r\n\r\n## TODO\r\n\r\n- [x] Remove our use of LocalAppData in Update.exe\r\n- [x] Rig Setup to fall back to ProgramData\r\n- [ ] Remove LocalAppData from Squirrel\r\n- [ ] Make sure this works everywhere","created_at":"2015-04-14T22:36:23Z","updated_at":"2015-04-14T23:20:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"357fca8d7660b5526c68fc2780028c25bdb0a439","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308/commits","review_comments_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308/comments","review_comment_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/308/comments","statuses_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/statuses/ce59c169ef759e22cda3c6523b2f5c6756c339cb","head":{"label":"Squirrel:program-data-insanity","ref":"program-data-insanity","sha":"ce59c169ef759e22cda3c6523b2f5c6756c339cb","user":{"login":"Squirrel","id":5743792,"avatar_url":"https://avatars.githubusercontent.com/u/5743792?v=3","gravatar_id":"","url":"https://api.github.com/users/Squirrel","html_url":"https://github.com/Squirrel","followers_url":"https://api.github.com/users/Squirrel/followers","following_url":"https://api.github.com/users/Squirrel/following{/other_user}","gists_url":"https://api.github.com/users/Squirrel/gists{/gist_id}","starred_url":"https://api.github.com/users/Squirrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Squirrel/subscriptions","organizations_url":"https://api.github.com/users/Squirrel/orgs","repos_url":"https://api.github.com/users/Squirrel/repos","events_url":"https://api.github.com/users/Squirrel/events{/privacy}","received_events_url":"https://api.github.com/users/Squirrel/received_events","type":"Organization","site_admin":false},"repo":{"id":22338518,"name":"Squirrel.Windows","full_name":"Squirrel/Squirrel.Windows","owner":{"login":"Squirrel","id":5743792,"avatar_url":"https://avatars.githubusercontent.com/u/5743792?v=3","gravatar_id":"","url":"https://api.github.com/users/Squirrel","html_url":"https://github.com/Squirrel","followers_url":"https://api.github.com/users/Squirrel/followers","following_url":"https://api.github.com/users/Squirrel/following{/other_user}","gists_url":"https://api.github.com/users/Squirrel/gists{/gist_id}","starred_url":"https://api.github.com/users/Squirrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Squirrel/subscriptions","organizations_url":"https://api.github.com/users/Squirrel/orgs","repos_url":"https://api.github.com/users/Squirrel/repos","events_url":"https://api.github.com/users/Squirrel/events{/privacy}","received_events_url":"https://api.github.com/users/Squirrel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Squirrel/Squirrel.Windows","description":"An installation and update framework for Windows desktop apps","fork":false,"url":"https://api.github.com/repos/Squirrel/Squirrel.Windows","forks_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/forks","keys_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/teams","hooks_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/hooks","issue_events_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/events{/number}","events_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/events","assignees_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/assignees{/user}","branches_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/branches{/branch}","tags_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/tags","blobs_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/statuses/{sha}","languages_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/languages","stargazers_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/stargazers","contributors_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/contributors","subscribers_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/subscribers","subscription_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/subscription","commits_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/comments{/number}","contents_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/contents/{+path}","compare_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/merges","archive_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/downloads","issues_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues{/number}","pulls_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls{/number}","milestones_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/milestones{/number}","notifications_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/labels{/name}","releases_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/releases{/id}","created_at":"2014-07-28T10:10:39Z","updated_at":"2015-04-14T20:22:24Z","pushed_at":"2015-04-14T22:36:24Z","git_url":"git://github.com/Squirrel/Squirrel.Windows.git","ssh_url":"git@github.com:Squirrel/Squirrel.Windows.git","clone_url":"https://github.com/Squirrel/Squirrel.Windows.git","svn_url":"https://github.com/Squirrel/Squirrel.Windows","homepage":"","size":19389,"stargazers_count":711,"watchers_count":711,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":78,"forks":83,"open_issues":78,"watchers":711,"default_branch":"master"}},"base":{"label":"Squirrel:master","ref":"master","sha":"9d1fc7cfbd68df304bf89aadf3bfca29e5e59578","user":{"login":"Squirrel","id":5743792,"avatar_url":"https://avatars.githubusercontent.com/u/5743792?v=3","gravatar_id":"","url":"https://api.github.com/users/Squirrel","html_url":"https://github.com/Squirrel","followers_url":"https://api.github.com/users/Squirrel/followers","following_url":"https://api.github.com/users/Squirrel/following{/other_user}","gists_url":"https://api.github.com/users/Squirrel/gists{/gist_id}","starred_url":"https://api.github.com/users/Squirrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Squirrel/subscriptions","organizations_url":"https://api.github.com/users/Squirrel/orgs","repos_url":"https://api.github.com/users/Squirrel/repos","events_url":"https://api.github.com/users/Squirrel/events{/privacy}","received_events_url":"https://api.github.com/users/Squirrel/received_events","type":"Organization","site_admin":false},"repo":{"id":22338518,"name":"Squirrel.Windows","full_name":"Squirrel/Squirrel.Windows","owner":{"login":"Squirrel","id":5743792,"avatar_url":"https://avatars.githubusercontent.com/u/5743792?v=3","gravatar_id":"","url":"https://api.github.com/users/Squirrel","html_url":"https://github.com/Squirrel","followers_url":"https://api.github.com/users/Squirrel/followers","following_url":"https://api.github.com/users/Squirrel/following{/other_user}","gists_url":"https://api.github.com/users/Squirrel/gists{/gist_id}","starred_url":"https://api.github.com/users/Squirrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Squirrel/subscriptions","organizations_url":"https://api.github.com/users/Squirrel/orgs","repos_url":"https://api.github.com/users/Squirrel/repos","events_url":"https://api.github.com/users/Squirrel/events{/privacy}","received_events_url":"https://api.github.com/users/Squirrel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Squirrel/Squirrel.Windows","description":"An installation and update framework for Windows desktop apps","fork":false,"url":"https://api.github.com/repos/Squirrel/Squirrel.Windows","forks_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/forks","keys_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/teams","hooks_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/hooks","issue_events_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/events{/number}","events_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/events","assignees_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/assignees{/user}","branches_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/branches{/branch}","tags_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/tags","blobs_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/statuses/{sha}","languages_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/languages","stargazers_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/stargazers","contributors_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/contributors","subscribers_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/subscribers","subscription_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/subscription","commits_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/comments{/number}","contents_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/contents/{+path}","compare_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/merges","archive_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/downloads","issues_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues{/number}","pulls_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls{/number}","milestones_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/milestones{/number}","notifications_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/labels{/name}","releases_url":"https://api.github.com/repos/Squirrel/Squirrel.Windows/releases{/id}","created_at":"2014-07-28T10:10:39Z","updated_at":"2015-04-14T20:22:24Z","pushed_at":"2015-04-14T22:36:24Z","git_url":"git://github.com/Squirrel/Squirrel.Windows.git","ssh_url":"git@github.com:Squirrel/Squirrel.Windows.git","clone_url":"https://github.com/Squirrel/Squirrel.Windows.git","svn_url":"https://github.com/Squirrel/Squirrel.Windows","homepage":"","size":19389,"stargazers_count":711,"watchers_count":711,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":78,"forks":83,"open_issues":78,"watchers":711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308"},"html":{"href":"https://github.com/Squirrel/Squirrel.Windows/pull/308"},"issue":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/308"},"comments":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/Squirrel/Squirrel.Windows/statuses/ce59c169ef759e22cda3c6523b2f5c6756c339cb"}}}}