Add Windows installer

This commit is contained in:
Samuel Sloniker 2024-07-23 19:31:04 -07:00
parent 3b649f9c6a
commit 80e8274f7c
2 changed files with 37 additions and 1 deletions

View File

@ -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"

33
windows_installer.nsi Normal file
View File

@ -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