diff --git a/build-windows.bat b/build-windows.bat index ab46f97..8f680c1 100755 --- a/build-windows.bat +++ b/build-windows.bat @@ -1 +1,4 @@ -pyinstaller -i=icon.ico --windowed --onefile --hidden-import tornado.web --add-data icon.ico:files --name=navpoint-windows-%PROCESSOR_ARCHITECTURE%.exe main.py +pyinstaller -i=icon.ico --windowed --onefile --hidden-import tornado.web --add-data icon.ico:files --name=navpoint.exe main.py +"C:\Program Files (x86)\NSIS\makensis.exe" .\windows_installer.nsi +move "dist\navpoint.exe" "dist\navpoint-windows-%PROCESSOR_ARCHITECTURE%-portable.exe" +move "dist\NavpointInstaller.exe" "dist\navpoint-windows-%PROCESSOR_ARCHITECTURE%-installer.exe" diff --git a/windows_installer.nsi b/windows_installer.nsi new file mode 100644 index 0000000..0ed8489 --- /dev/null +++ b/windows_installer.nsi @@ -0,0 +1,33 @@ +OutFile "dist\NavpointInstaller.exe" +# define installation directory +InstallDir $PROFILE\Navpoint + +RequestExecutionLevel user + +Section + # set the installation directory as the destination for the following actions + SetOutPath $INSTDIR + + File dist\navpoint.exe + + # create the uninstaller + WriteUninstaller "$INSTDIR\uninstall.exe" + + # create a shortcut named "new shortcut" in the start menu programs directory + # point the new shortcut at the program uninstaller + CreateShortcut "$SMPROGRAMS\Uninstall Navpoint.lnk" "$INSTDIR\uninstall.exe" + CreateShortcut "$SMPROGRAMS\Navpoint.lnk" "$INSTDIR\navpoint.exe" +SectionEnd + +# uninstaller section start +Section "uninstall" + + # Remove the link from the start menu + Delete "$SMPROGRAMS\Uninstall Navpoint.lnk" + + # Delete the uninstaller + Delete $INSTDIR\uninstaller.exe + + RMDir $INSTDIR +# uninstaller section end +SectionEnd