fix windows build

This commit is contained in:
2024-11-17 21:22:55 +08:00
parent 458bc261f3
commit a1d1f504bd
3 changed files with 14 additions and 13 deletions

View File

@@ -93,25 +93,18 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: install yq
run: choco install yq -y
- name: install wget
run: choco install wget -y
- name: install dependencies
run: |
choco install yq -y
pip install httpx
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version-file: pubspec.yaml
architecture: x64
- name: install inno setup
run: |
choco install innosetup -y
$inno_path = "C:\Program Files (x86)\Inno Setup 6"
wget "https://raw.githubusercontent.com/kira-96/Inno-Setup-Chinese-Simplified-Translation/refs/heads/main/ChineseSimplified.isl" -OutFile "$inno_path\Languages\ChineseSimplified.isl"
- run: flutter pub get
- name: build
run: |
$inno_path = "C:\Program Files (x86)\Inno Setup 6\"
$env:PATH += ";$inno_path"
flutter pub get
python windows/build.py
- uses: actions/upload-artifact@v4
with:

View File

@@ -33,7 +33,7 @@ WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
Name: "chinesesimplified"; MessagesFile: "{#RootPath}\windows\ChineseSimplified.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

View File

@@ -1,5 +1,6 @@
import subprocess
import os
import httpx
file = open('pubspec.yaml', 'r')
content = file.read()
@@ -26,6 +27,13 @@ file = open('windows/build.iss', 'w')
file.write(newContent)
file.close()
if not os.path.exists("windows/ChineseSimplified.isl"):
# download ChineseSimplified.isl
url = "https://raw.githubusercontent.com/kira-96/Inno-Setup-Chinese-Simplified-Translation/refs/heads/main/ChineseSimplified.isl"
response = httpx.get(url)
with open('windows/ChineseSimplified.isl', 'wb') as file:
file.write(response.content)
subprocess.run(["iscc", "windows/build.iss"], shell=True)
with open('windows/build.iss', 'w') as file: