mirror of
https://github.com/c9moser/sgbackup.git
synced 2026-01-19 19:40:13 +00:00
create and execute install.ps1 in msys-install.sh
This commit is contained in:
parent
c4c4dfe8f8
commit
f2c188a500
@ -6,7 +6,7 @@ PROJECT_DIR="$( dirname "$SELF")"
|
||||
|
||||
PACKAGES="gtk4 gobject-introspection python-gobject python-rapidfuzz"
|
||||
|
||||
_install_pkg=""
|
||||
_install_pkg="base-devel"
|
||||
for i in $PACKAGES; do
|
||||
_install_pkg="${_install_pkg} ${MINGW_PACKAGE_PREFIX}-$i"
|
||||
done
|
||||
@ -30,10 +30,11 @@ cat > "${bindir}/sgbackup" << EOF
|
||||
python -m sgbackup "\$@"
|
||||
EOF
|
||||
|
||||
cat > "${bindir}/sgbackup.bat" << EOF
|
||||
@ECHO OFF\r
|
||||
"$pythonpath" -m sgbackup %*\r
|
||||
cat > "${bindir}/sgbackup.cmd" << EOF
|
||||
@ECHO OFF
|
||||
"$pythonpath" -m sgbackup %*
|
||||
EOF
|
||||
unix2dos "${bindir}/sgbackup.cmd"
|
||||
|
||||
cat > "${bindir}/gsgbackup" << EOF
|
||||
#!/bin/bash
|
||||
@ -41,8 +42,33 @@ cat > "${bindir}/gsgbackup" << EOF
|
||||
python -m sgbackup.gui "\$@"
|
||||
EOF
|
||||
|
||||
cat > "${bindir}/gsgbackup.bat" << EOF
|
||||
@ECHO OFF\r
|
||||
cat > "${bindir}/gsgbackup.cmd" << EOF
|
||||
@ECHO OFF
|
||||
"$pythonpath" -m sgbackup.gui %*
|
||||
EOF
|
||||
unix2dos "${bindir}/gsgbackup.cmd"
|
||||
|
||||
install_ps1="${PRJECT_DIR}/install.ps1"
|
||||
wproject_dir="$( cygpath -w "${PROJECT_DIR}" )"
|
||||
|
||||
cat > "$install_ps1" << EOF
|
||||
[Environment]::SetEnvironemtnVariable("Path","\$env:PATH;$wbindir","User")
|
||||
|
||||
\$desktop_dir=[Environment]::getFolderPath("Desktop")
|
||||
\$startmenu_dir=[Environment]::getFolderPath("StartMenu")
|
||||
\$picture_dir=[Environment]::getFolderPath("MyPictures")
|
||||
|
||||
Copy-Item -Path "$wproject_dir\\sgbackup\\icons\\sgbackup.ico" -Destination "\$picture_dir\\sgbackup.ico" -Force
|
||||
|
||||
foreach (\$dir in \$desktop_dir,\$startmenu_dir) {
|
||||
\$shell=New-Object -ComObject WScript.Shell
|
||||
\$shortcut=\$shell.CreateShortcut('\$dir\\sgbackup.lnk')
|
||||
\$shortcut.TargetPath='$wbindir\\gsgbackup.cmd'
|
||||
\$shortcut.IconLocation="\$picture_dir\\sgbackup.ico"
|
||||
\$shortcut.Save()
|
||||
}
|
||||
EOF
|
||||
unix2dos "$install_ps1"
|
||||
powershell -File "$( cygpath -w "$install_ps1" )"
|
||||
rm "$install_ps1"
|
||||
|
||||
|
||||
BIN
sgbackup/icons/sgbackup-symbolic.png
Normal file
BIN
sgbackup/icons/sgbackup-symbolic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
sgbackup/icons/sgbackup.ico
Normal file
BIN
sgbackup/icons/sgbackup.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue
Block a user