Skip to content

Commit 1f9891f

Browse files
Merge pull request #91 from vaccfr/dev
Auto-Update Installer + Various Fixes
2 parents ca21393 + e377cb1 commit 1f9891f

6 files changed

Lines changed: 257 additions & 52 deletions

File tree

‎.github/workflows/build-installer.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Build Installer EXE
3333
working-directory: scripts/installer
3434
run: |
35-
pyinstaller --onefile --noupx --windowed --icon ProfileConfigurator.ico --add-data "ProfileConfigurator.ico;." --version-file version_info.txt --name "Installer" app.py
35+
pyinstaller --onefile --noupx --windowed --icon ProfileConfigurator.ico --add-data "ProfileConfigurator.ico;." --version-file version_info.txt --name "ControllerPackInstaller" app.py
3636
3737
- uses: actions/upload-artifact@v4
3838
with:

‎.github/workflows/release-exes.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ jobs:
2424
$shortSha = "${{ github.sha }}".Substring(0, 7)
2525
Set-Content -Path "scripts/installer/build_info.py" -Value "BUILD_COMMIT = '$shortSha'"
2626
Add-Content -Path "scripts/installer/build_info.py" -Value "BUILD_BRANCH = '${{ github.ref_name }}'"
27+
Add-Content -Path "scripts/installer/build_info.py" -Value "BUILD_TAG = '${{ github.event.release.tag_name }}'"
2728
2829
- name: Build Installer
2930
working-directory: scripts/installer
3031
run: |
3132
python -m pip install --upgrade pip
3233
pip install -r requirements.txt
33-
pyinstaller --onefile --noupx --windowed --icon ProfileConfigurator.ico --add-data "ProfileConfigurator.ico;." --version-file version_info.txt --name "Installer" app.py
34+
pyinstaller --onefile --noupx --windowed --icon ProfileConfigurator.ico --add-data "ProfileConfigurator.ico;." --version-file version_info.txt --name "ControllerPackInstaller" app.py
3435
3536
- name: Build Profile Configurator
3637
working-directory: scripts/profileconfigurator

‎scripts/installer/app.py‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
from tkinter import filedialog, messagebox
55

66
from config import APP_NAME
7-
from engine import update_controller_pack, get_local_version, get_github_version
7+
from engine import (
8+
update_controller_pack,
9+
get_local_version,
10+
get_github_version,
11+
tool_update_available,
12+
self_update_tools,
13+
)
814

915
try:
1016
from build_info import BUILD_COMMIT, BUILD_BRANCH
@@ -130,6 +136,27 @@ def __init__(self, root):
130136
self.auto_detect_start_directory()
131137
self.refresh_versions()
132138
self.refresh_action_button()
139+
self.check_tool_update_on_startup()
140+
141+
def check_tool_update_on_startup(self):
142+
try:
143+
available, latest_tag = tool_update_available()
144+
145+
if not available:
146+
return
147+
148+
should_update = messagebox.askyesno(
149+
"Installer update available",
150+
f"A newer installer release is available: {latest_tag}\n\n"
151+
"Do you want to update ControllerPackInstaller.exe and ProfileConfigurator.exe now?",
152+
)
153+
154+
if should_update:
155+
current_dir = get_start_directory()
156+
self_update_tools(current_dir)
157+
158+
except Exception as error:
159+
print(f"Tool update check failed: {error}")
133160

134161
def auto_detect_start_directory(self):
135162
start_dir = get_start_directory()
@@ -246,7 +273,7 @@ def ask_backup_settings(self) -> bool:
246273
"The update will modify files inside LFXX/Settings.\n\n"
247274
"No previous settings backup was detected in:\n"
248275
"LFXX/Settings/settings_backup\n\n"
249-
"Do you want the installer to create a backup before continuing?"
276+
"Do you want the installer to create a backup before continuing?",
250277
)
251278

252279
def run_update(self):

‎scripts/installer/build_info.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BUILD_COMMIT = "dev"
2-
BUILD_BRANCH = "local"
2+
BUILD_BRANCH = "local"
3+
BUILD_TAG = "dev"

0 commit comments

Comments
 (0)