Skip to content

Commit 3df6288

Browse files
committed
Fixed deploy script.
1 parent 4ec5101 commit 3df6288

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

scripts/deploy.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ cp "${EXECUTABLE}" "${INSTALL_TARGET}/bin/${EXECUTABLE_NAME}"
5454
if [ "$IS_WINDOWS" = true ]; then
5555
# use ldd to copy dependencies from msys2 into the bin dir
5656
ldd "${EXECUTABLE}" | grep "clang" | awk 'NF == 4 { system("cp " $3 " '"${INSTALL_TARGET}/bin/"'") }'
57-
else
57+
fi
5858

5959
# Assets (Images, icons, language files)...
6060
cp -r "${SOURCE_DIRECTORY}/static/assets/." "${INSTALL_TARGET}/assets"
@@ -71,7 +71,15 @@ if [ "$NOLINK" = false ]; then
7171
# Dont create a symlink on windows or if NOLINK is true
7272
ln -s "./bin/${EXECUTABLE_NAME}" "${INSTALL_TARGET}/${EXECUTABLE_NAME}"
7373
else
74-
# Instead create a shortcut on windows
75-
powershell -Command "New-Item -ItemType SymbolicLink -Path '${INSTALL_TARGET}/${EXECUTABLE_NAME}' -Target './bin/${EXECUTABLE_NAME}'"
74+
# Convert to Windows path
75+
WIN_INSTALL_TARGET=$(cygpath -w "${INSTALL_TARGET}")
76+
77+
powershell -Command "
78+
\$WshShell = New-Object -ComObject WScript.Shell;
79+
\$Shortcut = \$WshShell.CreateShortcut('${WIN_INSTALL_TARGET}\\${EXECUTABLE_NAME}.lnk');
80+
\$Shortcut.TargetPath = '.\\bin\\${EXECUTABLE_NAME}';
81+
\$Shortcut.WorkingDirectory = '${WIN_INSTALL_TARGET}';
82+
\$Shortcut.Save();
83+
"
7684
fi
7785
fi

0 commit comments

Comments
 (0)