Skip to content

Commit 7ae3f37

Browse files
author
nothing
committed
renaming and other fixes
1 parent 447d276 commit 7ae3f37

5 files changed

Lines changed: 15 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build/
22
dist/
33
app.log
4-
Keychron_updater.spec
5-
innosetup/Keychron_updater_setup.exe
4+
Keychron_mice_updater.spec
5+
innosetup/Keychron_mice_updater_setup.exe
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import requests, gdown, zipfile, os, ctypes, tempfile, shutil, subprocess, logging
1+
import requests, gdown, zipfile, os, ctypes, tempfile, shutil, subprocess
22
from tkinter import messagebox
33

4-
logging.basicConfig(filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s')
5-
64
install_path = "C:\\Program Files (x86)\\Keychron"
75

86
def get_installed_version():
@@ -11,7 +9,6 @@ def get_installed_version():
119
installed_version = f.read().split('<software caption="Keychron" version="')[1].split('"')[0]
1210
return installed_version
1311
except Exception as e:
14-
logging.error(f"Failed to get installed version: {e}")
1512
messagebox.showerror("Error", f"Failed to get installed version: {e}")
1613

1714
def get_online_version_and_url():
@@ -28,16 +25,14 @@ def get_online_version_and_url():
2825

2926
return online_version, download_url
3027
except Exception as e:
31-
logging.error(f"Failed to get online version and url: {e}")
3228
messagebox.showerror("Error", f"Failed to get online version and url: {e}")
3329

3430
def download_and_extract_file(download_url, tmp_path):
3531
try:
36-
gdown.download(download_url, tmp_path + '\\Keychron.zip', quiet=False)
32+
gdown.download(download_url, tmp_path + '\\Keychron.zip', quiet=True)
3733
with zipfile.ZipFile(tmp_path + '\\Keychron.zip', 'r') as zip_ref:
3834
zip_ref.extractall(tmp_path)
3935
except Exception as e:
40-
logging.error(f"Failed to download and extract file: {e}")
4136
messagebox.showerror("Error", f"Failed to download and extract file: {e}")
4237

4338
def run_exe(tmp_path):
@@ -48,7 +43,6 @@ def run_exe(tmp_path):
4843
process = subprocess.Popen([os.path.join(root, file)], shell=True)
4944
process.wait()
5045
except Exception as e:
51-
logging.error(f"Failed to run exe: {e}")
5246
messagebox.showerror("Error", f"Failed to run exe: {e}")
5347

5448
def main():
@@ -65,7 +59,6 @@ def main():
6559
run_exe(tmp_path)
6660
shutil.rmtree(tmp_path)
6761
except Exception as e:
68-
logging.error(f"An error occurred: {e}")
6962
messagebox.showerror("Error", f"An error occurred: {e}")
7063

7164
if __name__ == "__main__":

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pyinstaller --onefile --noconsole Keychron_updater.py
1+
pyinstaller --onefile --noconsole Keychron_mice_updater.py

innosetup/setup.iss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[Setup]
2-
AppName=Keychron Software Update
2+
AppName=Keychron Mice Software Updater
33
AppVersion=1.0
4-
DefaultDirName={commonpf}\Keychron Software Update
5-
DefaultGroupName=Keychron Software Update
4+
DefaultDirName={commonpf}\Keychron Mice Software Updater
5+
DefaultGroupName=Keychron Mice Software Updater
66
UninstallDisplayIcon={app}\keychron.exe
77
OutputDir=.
8-
OutputBaseFilename=Keychron_updater_setup
8+
OutputBaseFilename=Keychron_mice_updater_setup
99
Compression=lzma
1010
SolidCompression=yes
1111

1212
[Files]
13-
Source: "..\dist\Keychron_updater.exe"; DestDir: "{app}"; Flags: ignoreversion
13+
Source: "..\dist\Keychron_mice_updater.exe"; DestDir: "{app}"; Flags: ignoreversion
1414

1515
[Icons]
16-
Name: "{group}\Keychron Software Updater"; Filename: "{app}\Keychron_updater.exe"
17-
Name: "{group}\Uninstall Keychron Software Updater"; Filename: "{uninstallexe}"
18-
Name: "{commonstartup}\Keychron Software Updater"; Filename: "{app}\Keychron_updater.exe"; Tasks: autostart
16+
Name: "{group}\Keychron Mice Software Updater"; Filename: "{app}\Keychron_mice_updater.exe"
17+
Name: "{group}\Uninstall Keychron Mice Software Updater"; Filename: "{uninstallexe}"
18+
Name: "{commonstartup}\Keychron Mice Software Updater"; Filename: "{app}\Keychron_mice_updater.exe"; Tasks: autostart
1919

2020
[Run]
21-
Filename: "{app}\Keychron_updater.exe"; Description: "Launch the application"; Flags: nowait postinstall skipifsilent
21+
Filename: "{app}\Keychron_mice_updater.exe"; Description: "Launch the application"; Flags: nowait postinstall skipifsilent
2222

2323
[Tasks]
2424
Name: "autostart"; Description: "Start the application when Windows starts"; GroupDescription: "Additional tasks"; Flags: checkedonce

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This Python script automatically checks for a new version of the Keychron mice s
1616

1717
## Installation
1818

19-
1. Navigate to the [Releases](https://github.com/Pyenb/Keychron_software_updater/releases) section of this repository.
19+
1. Navigate to the [Releases](https://github.com/Pyenb/Keychron_mice_software_updater/releases) section of this repository.
2020
2. Download the latest release of the Keychron Software Updater.
2121
3. Extract the downloaded `.zip` file.
2222
4. Run the downloaded `.exe` file to start the installation process. Follow the prompts to complete the installation.

0 commit comments

Comments
 (0)