Skip to content

Commit

Permalink
Try to make it work on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
justaCasualCoder committed Dec 23, 2023
1 parent 20e8ddc commit 24bc086
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/onpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
python-version: '3.x' # Specify the Python version you need

- name: Install dependencies
run: pip install pyinstaller PySide6 beautifulsoup4 requests
run: pip install -r requiremnts.txt
- name: Install Heimdall
run: sudo apt install heimdall-flash -y
run: sudo apt update && sudo apt install heimdall-flash -y

- name: Build executable
run: pyinstaller --onefile --noconsole --add-binary "/bin/heimdall:." --add-data "$(pwd)/python-logo-only.svg:." guiunstable.py && mv dist/guiunstable dist/LinuxGUI && chmod +x dist/LinuxGUI
run: pyinstaller --onefile --noconsole --add-binary "/bin/heimdall:heimdall/heimdall_linux" --add-data "$(pwd)/python-logo-only.svg:." guiunstable.py && mv dist/guiunstable dist/LinuxGUI && chmod +x dist/LinuxGUI
working-directory: ${{ github.workspace }}

- name: Create info file
Expand Down
4 changes: 2 additions & 2 deletions guiunstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ def start_process(self, partition, image):
self.p.readyReadStandardError.connect(self.handle_stderr)
self.p.stateChanged.connect(self.handle_state)
self.p.finished.connect(self.process_finished) # Clean up once complete.
heimdallbin = os.path.abspath(os.path.join(cwd, "heimdall"))
heimdallbin = os.path.abspath(os.path.join(cwd, "heimdall/heimdall_linux"))
if os.name == 'nt':
print("Running on Windows!")
print("Running heimdall.exe")
heimdallbin = "./heimdall/heimdall.exe"
else:
if os.path.exists(heimdallbin):
print("Using Bundled Heimdall")
heimdallbin = "./heimdall"
heimdallbin = "./heimdall/heimdall_linux"
else:
heimdallbin = "/bin/heimdall"
command = [f"{heimdallbin}", "flash", f"--{partition}", image]
Expand Down
3 changes: 2 additions & 1 deletion requiremnts.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PySide6
requests
BeautifulSoup4
BeautifulSoup4
pyinstaller

0 comments on commit 24bc086

Please sign in to comment.