diff --git a/docker-builder-data/build/script/packet/papagayong-master.files/build-win.sh b/docker-builder-data/build/script/packet/papagayong-master.files/build-win.sh index c9d45ba..c505cdf 100755 --- a/docker-builder-data/build/script/packet/papagayong-master.files/build-win.sh +++ b/docker-builder-data/build/script/packet/papagayong-master.files/build-win.sh @@ -5,6 +5,7 @@ set -e ROOT_DIR=$1 +FILES_DIR=$(cd `dirname "$0"`; pwd) SOURCE_DIR="$ROOT_DIR/unpack/papagayo-ng" BUILD_DIR="$ROOT_DIR/build" PREBUILT_URL="https://github.com/morevnaproject/papagayo-ng/releases/download/v1.4.0/papagayo-ng-1.4.0-win.zip" @@ -31,7 +32,9 @@ if [ ! -f "$BUILD_DIR/papagayo-ng-$VERSION-win-installer.exe" ] \ cd "$BUILD_DIR/$TARGET_DIR" rm -rf papagayo-ng ln -s "$SOURCE_DIR" papagayo-ng - makensis papagayo-ng.nsi + cp "$FILES_DIR/papagayo-ng.nsi" . + cp "$FILES_DIR/papagayo-ng.bat" . + makensis papagayo-ng.nsi cd "$BUILD_DIR" zip -r "$TARGET_DIR.zip" "$TARGET_DIR" diff --git a/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.bat b/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.bat new file mode 100644 index 0000000..30974b5 --- /dev/null +++ b/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.bat @@ -0,0 +1,3 @@ +%~d0 +cd "%~dp0" +python.exe papagayo-ng\papagayo-ng.py %* diff --git a/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.nsi b/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.nsi new file mode 100644 index 0000000..c30b91f --- /dev/null +++ b/docker-builder-data/build/script/packet/papagayong-master.files/papagayo-ng.nsi @@ -0,0 +1,63 @@ +OutFile "..\papagayo-ng-installer.exe" +InstallDir "$PROGRAMFILES\Papagayo-NG" +Name "Papagayo-NG" + +SetCompressor /final lzma +!include MUI2.nsh + +Icon "papagayo-ng\papagayo-ng.ico" +UninstallIcon "papagayo-ng\papagayo-ng.ico" + +LicenseData "papagayo-ng\gpl.txt" +!insertmacro MUI_PAGE_LICENSE "papagayo-ng\gpl.txt" + +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +Section "Papagayo-NG (required)" + SectionIn RO + WriteRegStr HKLM "Software\$(^Name)" "Path" "$INSTDIR" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" "$INSTDIR\uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "HelpLink" "https://github.com/morevnaproject/papagayo-ng" + + WriteRegStr HKCR ".pgo" "" "Papagayo.Document" + WriteRegStr HKCR "Papagayo.Document" "" "Papagayo Document" + WriteRegStr HKCR "Papagayo.Document\DefaultIcon" "" "$INSTDIR\papagayo-ng\papagayo-ng.ico" + WriteRegStr HKCR "Papagayo.Document\shell\open\command" "" '"$INSTDIR\papagayo-ng.bat" "%1"' + + SetOutPath $INSTDIR + File /r /x papagayo-ng.nsi * + WriteUninstaller "uninstall.exe" +SectionEnd + +Section "Start Menu Shortcuts" + SetShellVarContext all + CreateDirectory "$SMPROGRAMS\$(^Name)" + CreateShortCut "$SMPROGRAMS\$(^Name)\$(^Name).lnk" "$INSTDIR\papagayo-ng.bat" "" "$INSTDIR\papagayo-ng\papagayo-ng.ico" + CreateShortCut "$SMPROGRAMS\$(^Name)\Uninstall $(^Name).lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\papagayo-ng\papagayo-ng.ico" +SectionEnd + +Section "Uninstall" + Var /GLOBAL testkey + + DeleteRegKey HKLM "Software\$(^Name)\" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + + ReadRegStr $testkey HKCR "Papagayo.Document\DefaultIcon" "" + StrCmp $testkey "$INSTDIR\papagayo-ng\papagayo-ng.ico" 0 +2 + DeleteRegKey HKCR "Papagayo.Document\DefaultIcon" + + ReadRegStr $testkey HKCR "Papagayo.Document\shell\open\command" "" + StrCmp $testkey '"$INSTDIR\papagayo-ng.bat" "%1"' 0 +2 + DeleteRegKey HKCR "Papagayo.Document\shell\open\command" + + Delete "$INSTDIR\*.*" + RMDir /r "$INSTDIR" + Delete "$SMPROGRAMS\$(^Name)\*.*" + RMDir "$SMPROGRAMS\$(^Name)" +SectionEnd +