-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
271 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** Post-Install Cleanup **/ | ||
|
||
var app = getArg(0); | ||
|
||
if (app) { | ||
removeStartupEntries(app); | ||
} else { | ||
WScript.Echo("No app name provided. Exiting."); | ||
WScript.Quit(1); | ||
} | ||
|
||
WScript.Quit(0); | ||
|
||
/** | ||
* Cycles through all users on system and removes matching startup entries. | ||
*/ | ||
function removeStartupEntries(app) { | ||
WScript.Echo('Removing startup entries for all users matching "' + app + '"'); | ||
var shell = new ActiveXObject("WScript.shell"); | ||
// get all users | ||
var proc = shell.Exec('reg.exe query HKU'); | ||
var users = proc.StdOut.ReadAll().split(/[\r\n]+/); | ||
for (var i = 0; i < users.length; i++) { | ||
try { | ||
var key = trim(users[i]) + "\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\" + app; | ||
shell.RegDelete(key); | ||
WScript.Echo(' - [success] Removed "' + app + '" startup in ' + users[i]); | ||
} catch(ignore) {} | ||
} | ||
} | ||
|
||
/* | ||
* Gets then nth argument passed into this script | ||
* Returns defaultVal if argument wasn't found | ||
*/ | ||
function getArg(index, defaultVal) { | ||
if (index >= WScript.Arguments.length || trim(WScript.Arguments(index)) == "") { | ||
return defaultVal; | ||
} | ||
return WScript.Arguments(index); | ||
} | ||
|
||
/* | ||
* Functional equivalent of foo.trim() | ||
*/ | ||
function trim(val) { | ||
return val.replace(/^\s+/,'').replace(/\s+$/,''); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.