This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from meshtastic/update_winapp
update meshtastic WinApp to check for py; add icon; add metadata with…
- Loading branch information
Showing
3 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,72 @@ | ||
; meshtastic-flasher install | ||
; meshtastic-flasher WinApp - create python virtual environment and run meshtastic-flasher | ||
|
||
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** | ||
#AutoIt3Wrapper_Icon=meshtastic.ico | ||
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** | ||
|
||
#pragma compile(UPX, False) | ||
#pragma compile(FileDescription, Meshtastic Flasher WinApp) | ||
#pragma compile(ProductName, Meshtastic Flasher) | ||
#pragma compile(ProductVersion, 1.0.2) | ||
#pragma compile(FileVersion, 1.0.2.0) | ||
#pragma compile(CompanyName, 'Meshtastic.org') | ||
|
||
#include <AutoItConstants.au3> | ||
#include <MsgBoxConstants.au3> | ||
|
||
FileChangeDir(@HomePath) | ||
|
||
If Not FileExists("meshtastic-flasher\") Then | ||
MsgBox("", "test2", "creating dir") | ||
MsgBox("", "Info", "creating dir") | ||
DirCreate("meshtastic-flasher") | ||
EndIf | ||
FileChangeDir("meshtastic-flasher") | ||
|
||
If Not FileExists("venv\") Then | ||
$CMD = "py -m venv venv" | ||
RunWait(@ComSpec & " /c " & $CMD) | ||
; check if py is a valid command | ||
Local $sPython = "py" | ||
Local $CMD = $sPython & " --version" | ||
Local $iPid = Run(@ComSpec & " /c " & $CMD, @TempDir, @SW_HIDE, $STDOUT_CHILD) | ||
|
||
; wait until the process has closed | ||
ProcessWaitClose($iPid) | ||
|
||
; read the output from the first python check | ||
Local $sOutput = StdoutRead($iPid) | ||
;MsgBox($MB_SYSTEMMODAL, "Info", "output:" & $sOutput) | ||
|
||
; see if we found a valid python3 version | ||
Local $iPosition = StringInStr($sOutput, "Python 3.") | ||
;MsgBox($MB_SYSTEMMODAL, "Info", "iPosition:" & $iPosition) | ||
|
||
If $iPosition = 0 Then | ||
; check if python3 is a valid command | ||
$sPython = "python3" | ||
$CMD = $sPython & " --version" | ||
$iPid = Run(@ComSpec & " /c " & $CMD, @TempDir, @SW_HIDE, $STDOUT_CHILD) | ||
|
||
; wait until the process has closed | ||
ProcessWaitClose($iPid) | ||
|
||
; read the output from the first python check | ||
$sOutput = StdoutRead($iPid) | ||
;MsgBox($MB_SYSTEMMODAL, "Info", "output:" & $sOutput) | ||
|
||
$iPosition = StringInStr($sOutput, "Python 3.") | ||
;MsgBox($MB_SYSTEMMODAL, "Info", "iPosition:" & $iPosition) | ||
|
||
If $iPosition = 0 Then | ||
MsgBox($MB_SYSTEMMODAL, "Warning", "Error: Could not find 'py' nor 'python3'. Please install Python3 before continuing.") | ||
$sPython = "" | ||
Endif | ||
Endif | ||
|
||
$CMD = "venv\Scripts\activate & py -m pip install --upgrade pip & pip install --upgrade meshtastic-flasher & meshtastic-flasher" | ||
RunWait(@ComSpec & " /c " & $CMD) | ||
; if we found a valid python | ||
If $sPython <> "" Then | ||
If Not FileExists("venv\") Then | ||
$CMD = $sPython & " -m venv venv" | ||
RunWait(@ComSpec & " /c " & $CMD) | ||
Endif | ||
|
||
$CMD = "venv\Scripts\activate & " & $sPython & " -m pip install --upgrade pip & pip install --upgrade meshtastic-flasher & meshtastic-flasher" | ||
RunWait(@ComSpec & " /c " & $CMD) | ||
EndIf |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Install AutoIt | ||
|
||
Compile to x86 exe | ||
Compile to x86 from the SciTE - Lite editor (right click on .au3 file and select "Edit") |