mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
update windows build script
This commit is contained in:
@@ -24,8 +24,8 @@ DisableProgramGroupPage=yes
|
||||
; Uncomment the following line to run in non administrative install mode (install for current user only.)
|
||||
;PrivilegesRequired=lowest
|
||||
PrivilegesRequiredOverridesAllowed=dialog
|
||||
OutputDir=C:\Users\wgh19\IdeaProjects\pixes\build\windows
|
||||
OutputBaseFilename=pixes-windows-installer
|
||||
OutputDir={#RootPath}\build\windows
|
||||
OutputBaseFilename=pixes-{#MyAppVersion}-windows-installer
|
||||
SetupIconFile={#RootPath}\windows\runner\resources\app_icon.ico
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
@@ -35,7 +35,7 @@ ArchitecturesAllowed=x64 arm64
|
||||
|
||||
[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
|
||||
|
@@ -1,17 +1,18 @@
|
||||
import subprocess
|
||||
import os
|
||||
import httpx
|
||||
|
||||
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
file = open('pubspec.yaml', 'r')
|
||||
content = file.read()
|
||||
file.close()
|
||||
|
||||
subprocess.run(["flutter", "build", "windows"], shell=True)
|
||||
|
||||
if os.path.exists("build/app-windows.zip"):
|
||||
os.remove("build/app-windows.zip")
|
||||
version = str.split(str.split(content, 'version: ')[1], '+')[0]
|
||||
|
||||
subprocess.run(["tar", "-a", "-c", "-f", "build/windows/x64/app-windows.zip", "-C", "build/windows/x64/runner/Release", "."]
|
||||
subprocess.run(["tar", "-a", "-c", "-f", f"build/windows/pixes-{version}-windows.zip", "-C", "build/windows/x64/runner/Release", "*"]
|
||||
, shell=True)
|
||||
|
||||
version = str.split(str.split(content, 'version: ')[1], '+')[0]
|
||||
issContent = ""
|
||||
file = open('windows/build.iss', 'r')
|
||||
issContent = file.read()
|
||||
@@ -23,7 +24,14 @@ 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:
|
||||
file.write(issContent)
|
||||
file.write(issContent)
|
Reference in New Issue
Block a user