From e48d9039dacf60dad6a6098d1b90ee970c59b9c7 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Mon, 29 Jul 2024 20:01:28 -0700 Subject: [PATCH 1/6] Replace cmd build script with PowerShell script --- build-windows.bat | 4 ---- build-windows.ps1 | 9 +++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) delete mode 100755 build-windows.bat create mode 100644 build-windows.ps1 diff --git a/build-windows.bat b/build-windows.bat deleted file mode 100755 index c727049..0000000 --- a/build-windows.bat +++ /dev/null @@ -1,4 +0,0 @@ -pyinstaller -i=icon.ico --windowed --onefile --hidden-import tornado.web --add-data icon.ico:files --add-data README.md:files --add-data GPL-3.0.txt:files --add-data CC-BY-SA-4.0.txt: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/build-windows.ps1 b/build-windows.ps1 new file mode 100644 index 0000000..58d272f --- /dev/null +++ b/build-windows.ps1 @@ -0,0 +1,9 @@ +pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py" +& "C:\Program Files (x86)\NSIS\makensis.exe" ".\windows_installer.nsi" + +$distName = "navpoint-windows-$env:PROCESSOR_ARCHITECTURE" + +Remove-Item -Path "dist\$distName-*" + +Move-Item -Path "dist\navpoint.exe" -Destination "dist\$distName-portable.exe" +Move-Item -Path "dist\NavpointInstaller.exe" -Destination "dist\$distName-installer.exe" From f74c6ea38023e3c0af163a26b2dea3f5aea604c1 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 09:25:50 -0700 Subject: [PATCH 2/6] Add version number to READE --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb2846b..75990e9 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Navpoint Desktop +# Navpoint Desktop v0.10dev [Navpoint](https://git.kj7rrv.com/kj7rrv/navpoint) makes the user's current location available in KML format over a local HTTP server (listening on From 1572244346eebf2b8c2f47c9eac40066554e1c07 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 09:26:07 -0700 Subject: [PATCH 3/6] Put version number in Windows builds --- build-windows.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-windows.ps1 b/build-windows.ps1 index 58d272f..e3db9a4 100644 --- a/build-windows.ps1 +++ b/build-windows.ps1 @@ -1,7 +1,9 @@ pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py" & "C:\Program Files (x86)\NSIS\makensis.exe" ".\windows_installer.nsi" -$distName = "navpoint-windows-$env:PROCESSOR_ARCHITECTURE" +$version = (Get-Content -Path README.md -TotalCount 1).Split()[3] + +$distName = "navpoint-$version-windows-$env:PROCESSOR_ARCHITECTURE" Remove-Item -Path "dist\$distName-*" From d54e44153d6379717ec482f01c5275a51a86ce7e Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 09:36:08 -0700 Subject: [PATCH 4/6] Add missing comma to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75990e9..cf6646b 100755 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ recommended where possible, is from a USB GPS receiver that supports the [NMEA 0183](https://en.wikipedia.org/wiki/NMEA_0183) protocol. (A handheld GPS receiver connected to a computer may or may not work; it does not work with my Garmin GPSMAP 64st. Any common USB GPS dongle, such as [this one available from -Amazon](https://www.amazon.com/VK-162-G-Mouse-External-Navigation-Raspberry/dp/B01EROIUEW/) +Amazon](https://www.amazon.com/VK-162-G-Mouse-External-Navigation-Raspberry/dp/B01EROIUEW/), should work, although, of course, I cannot guarantee that any particular device will be compatible with Navpoint. On Windows, USB mode should work out-of-the-box with a compatible GPS receiver; on Linux, your user account From afdac88880922cbab8e998fee56ec969b1a03f2b Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 09:40:00 -0700 Subject: [PATCH 5/6] Show version number on About button --- navpoint/run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/navpoint/run.py b/navpoint/run.py index d326a87..5d3e7d7 100755 --- a/navpoint/run.py +++ b/navpoint/run.py @@ -6,6 +6,9 @@ import navpoint.phone_server import navpoint.usb import navpoint.about +def _version(): + with open(navpoint.fix_path.fix_path("README.md")) as f: + return f.readline().split()[3] def run(): def _usb_clicked(): @@ -37,7 +40,7 @@ def run(): ttk.Separator(window, orient="horizontal").pack() ttk.Label(window, text="Navpoint is free and open-source.").pack() about_button = ttk.Button( - window, text="About Navpoint", command=navpoint.about.about + window, text="About Navpoint " + _version(), command=navpoint.about.about ) about_button.pack() From 765e00446e744a1db59fef9d6f97d766039b2ee9 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 30 Jul 2024 10:05:32 -0700 Subject: [PATCH 6/6] Improve Windows installer --- build-windows.ps1 | 13 ++++++++----- windows_installer.nsi | 22 ++++++---------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/build-windows.ps1 b/build-windows.ps1 index e3db9a4..504b8e1 100644 --- a/build-windows.ps1 +++ b/build-windows.ps1 @@ -1,11 +1,14 @@ -pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py" -& "C:\Program Files (x86)\NSIS\makensis.exe" ".\windows_installer.nsi" - $version = (Get-Content -Path README.md -TotalCount 1).Split()[3] - $distName = "navpoint-$version-windows-$env:PROCESSOR_ARCHITECTURE" Remove-Item -Path "dist\$distName-*" +pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py" + +(Get-Content ".\windows_installer.nsi" -Raw).Replace("<>", "$version").Replace("<>", "$distName") | Out-File ".\temp_installer.nsi" +& "C:\Program Files (x86)\NSIS\makensis.exe" ".\temp_installer.nsi" +Remove-Item -Path ".\temp_installer.nsi" + Move-Item -Path "dist\navpoint.exe" -Destination "dist\$distName-portable.exe" -Move-Item -Path "dist\NavpointInstaller.exe" -Destination "dist\$distName-installer.exe" + +# Move-Item -Path "dist\NavpointInstaller.exe" -Destination "dist\$distName-installer.exe" diff --git a/windows_installer.nsi b/windows_installer.nsi index 0ed8489..7d734d9 100644 --- a/windows_installer.nsi +++ b/windows_installer.nsi @@ -1,5 +1,5 @@ -OutFile "dist\NavpointInstaller.exe" -# define installation directory +Name "Navpoint <>" +OutFile "dist\<>-installer.exe" InstallDir $PROFILE\Navpoint RequestExecutionLevel user @@ -9,25 +9,15 @@ Section 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" + CreateShortcut "$DESKTOP\Navpoint.lnk" "$INSTDIR\navpoint.exe" + + WriteUninstaller "$INSTDIR\uninstall.exe" + CreateShortcut "$SMPROGRAMS\Uninstall Navpoint.lnk" "$INSTDIR\uninstall.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