create nw.js shortcuts on windows

pull/117/merge
nightwing 2015-06-02 21:06:09 +04:00
rodzic fe3be8eff9
commit 1412e15569
1 zmienionych plików z 26 dodań i 0 usunięć

Wyświetl plik

@ -1,5 +1,7 @@
#!/bin/bash -e
set -e
while [ "$1" ]; do
case "$1" in
--compress) COMPRESS=1 ;;
@ -111,6 +113,30 @@ if [ "$os" == "windows" ]; then
' > $dest/package.json
popd
# create shortcuts
echo '
var WshShell = WScript.CreateObject("WScript.Shell");
var strDesktop = WshShell.SpecialFolders("Desktop");
var cwd = WScript.ScriptFullName.replace(/\\[^\\]+$/, "");
var link1 = WshShell.CreateShortcut(cwd + "\\Cloud9#.lnk");
link1.TargetPath = cwd + "\\build\\win32-dev\\bin\\Cloud9.exe";
link1.IconLocation = cwd + "\\build\\win32\\Cloud9.ico";
link1.Description = "Cloud9";
link1.WorkingDirectory = cwd;
link1.Save();
var link2 = WshShell.CreateShortcut(cwd + "\\Cloud9#packed.lnk");
link2.TargetPath = link1.TargetPath;
link2.Arguments = "--packed --no-devtools";
link2.IconLocation = link1.IconLocation;
link2.Description = "Cloud9";
link2.WorkingDirectory = cwd;
link2.Save();
' > ./shortcut.wscript.js
cscript //NoLogo //B //E:jscript ./shortcut.wscript.js
rm -f ./shortcut.wscript.js
bash ./makelocal.sh
fi