Skip to content

Commit 533982e

Browse files
authored
Package Windows (#310)
* Add windows setup * path fixes * fix dll destination paths * fix paths in iss script * more path fixes * uncomment android and macos * comment playstore * re-enable android and macos * re-enable fastlane
1 parent 49897dd commit 533982e

2 files changed

Lines changed: 149 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ jobs:
4444
run: flutter build apk --release
4545
- name: Build appBundle
4646
run: flutter build appbundle
47+
- name: Prepare Android artifacts
48+
run: |
49+
mkdir -p release-artifacts
50+
cp build/app/outputs/flutter-apk/app-release.apk release-artifacts/
51+
cp build/app/outputs/bundle/release/app-release.aab release-artifacts/
4752
- name: Upload Artifacts
4853
uses: actions/upload-artifact@v6
4954
with:
50-
name: Releases
51-
path: |
52-
build/app/outputs/flutter-apk/app-release.apk
53-
build/app/outputs/bundle/release/app-release.aab
55+
name: android-artifacts
56+
path: release-artifacts/
5457
- name: Create google_service_account.json
5558
run: |
5659
echo "${{ secrets.GOOGLE_SERVICE_ACCOUNT }}" | base64 --decode > android/google_service_account.json
@@ -126,22 +129,64 @@ jobs:
126129
name: wispar-macos-dmg
127130
path: Wispar.dmg
128131

132+
build-windows:
133+
name: Build for Windows
134+
runs-on: windows-latest
135+
steps:
136+
- uses: actions/checkout@v6
137+
- name: Setup Flutter
138+
uses: subosito/flutter-action@v2
139+
with:
140+
channel: 'stable'
141+
- name: Flutter pub get
142+
run: flutter pub get
143+
- name: Build Windows release
144+
run: flutter build windows --release
145+
- name: Copy required DLLs
146+
shell: powershell
147+
run: |
148+
Copy-Item "C:\Windows\System32\msvcp140.dll" -Destination ".\build\windows\x64\runner\Release\"
149+
Copy-Item "C:\Windows\System32\msvcp140_1.dll" -Destination ".\build\windows\x64\runner\Release\"
150+
Copy-Item "C:\Windows\System32\msvcp140_2.dll" -Destination ".\build\windows\x64\runner\Release\"
151+
Copy-Item "C:\Windows\System32\vcruntime140.dll" -Destination ".\build\windows\x64\runner\Release\"
152+
Copy-Item "C:\Windows\System32\vcruntime140_1.dll" -Destination ".\build\windows\x64\runner\Release\"
153+
- name: Install Inno Setup
154+
shell: powershell
155+
run: |
156+
choco install innosetup -y
157+
refreshenv
158+
- name: Create Windows installer
159+
shell: powershell
160+
run: |
161+
$issPath = ".\windows\wispar_setup.iss"
162+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" $issPath
163+
- name: Upload Windows installer
164+
uses: actions/upload-artifact@v6
165+
with:
166+
name: windows-artifacts
167+
path: windows\output\wispar_setup.exe
168+
129169
create-release:
130170
name: Create GitHub Release
131171
runs-on: ubuntu-latest
132-
needs: [build-android, build-macos]
172+
needs: [build-android, build-macos, build-windows]
133173
steps:
134174
- uses: actions/checkout@v6
135175
- name: Download Android artifacts
136176
uses: actions/download-artifact@v6
137177
with:
138-
name: Releases
178+
name: android-artifacts
139179
path: android-artifacts
140180
- name: Download macOS artifact
141181
uses: actions/download-artifact@v6
142182
with:
143183
name: wispar-macos-dmg
144184
path: macos-artifacts
185+
- name: Download Windows artifact
186+
uses: actions/download-artifact@v6
187+
with:
188+
name: windows-artifacts
189+
path: windows-artifacts
145190
- name: Extract version from pubspec.yaml
146191
id: extract_version
147192
run: |
@@ -153,7 +198,8 @@ jobs:
153198
artifacts: |
154199
android-artifacts/app-release.apk,
155200
android-artifacts/app-release.aab,
156-
macos-artifacts/Wispar.dmg
201+
macos-artifacts/Wispar.dmg,
202+
windows-artifacts/wispar_setup.exe
157203
tag: v${{ env.VERSION }}
158204
token: ${{ secrets.TOKEN }}
159205
draft: true

windows/wispar_setup.iss

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#define MyAppName "Wispar"
2+
#define MyAppVersion "0.0.0+0"
3+
#define MyAppPublisher "Scriptbash"
4+
#define MyAppURL "https://wispar.app"
5+
#define MyAppSupportURL "https://github.com/Scriptbash/Wispar/issues"
6+
#define MyAppExeName "wispar.exe"
7+
8+
[Setup]
9+
AppId={{2515FBD1-05EF-45BA-B7AA-0FF2319A1DEE}
10+
AppName={#MyAppName}
11+
AppVersion={#MyAppVersion}
12+
;AppVerName={#MyAppName} {#MyAppVersion}
13+
AppPublisher={#MyAppPublisher}
14+
AppPublisherURL={#MyAppURL}
15+
AppSupportURL={#MyAppSupportURL}
16+
AppUpdatesURL={#MyAppURL}
17+
DefaultDirName={autopf}\{#MyAppName}
18+
UninstallDisplayIcon={app}\{#MyAppExeName}
19+
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
20+
; on anything but x64 and Windows 11 on Arm.
21+
ArchitecturesAllowed=x64compatible
22+
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
23+
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
24+
; meaning it should use the native 64-bit Program Files directory and
25+
; the 64-bit view of the registry.
26+
ArchitecturesInstallIn64BitMode=x64compatible
27+
DisableProgramGroupPage=yes
28+
LicenseFile=../LICENSE
29+
; Uncomment the following line to run in non administrative install mode (install for current user only).
30+
;PrivilegesRequired=lowest
31+
PrivilegesRequiredOverridesAllowed=dialog
32+
OutputDir=output
33+
OutputBaseFilename=wispar_setup
34+
SetupIconFile=../website/static/img/favicon.ico
35+
SolidCompression=yes
36+
WizardStyle=modern
37+
38+
[Languages]
39+
Name: "english"; MessagesFile: "compiler:Default.isl"
40+
Name: "arabic"; MessagesFile: "compiler:Languages\Arabic.isl"
41+
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl"
42+
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
43+
Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl"
44+
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
45+
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
46+
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
47+
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
48+
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
49+
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
50+
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
51+
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
52+
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
53+
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
54+
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
55+
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
56+
Name: "korean"; MessagesFile: "compiler:Languages\Korean.isl"
57+
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
58+
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
59+
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
60+
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
61+
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
62+
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
63+
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
64+
Name: "swedish"; MessagesFile: "compiler:Languages\Swedish.isl"
65+
Name: "tamil"; MessagesFile: "compiler:Languages\Tamil.isl"
66+
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
67+
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
68+
69+
[Tasks]
70+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
71+
72+
[Files]
73+
Source: "../build/windows/x64/runner/Release/{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
74+
Source: "../build/windows/x64/runner/Release/flutter_inappwebview_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
75+
Source: "../build/windows/x64/runner/Release/flutter_local_notifications_windows.dll"; DestDir: "{app}"; Flags: ignoreversion
76+
Source: "../build/windows/x64/runner/Release/flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion
77+
Source: "../build/windows/x64/runner/Release/msvcp140.dll"; DestDir: "{app}"; Flags: ignoreversion
78+
Source: "../build/windows/x64/runner/Release/msvcp140_1.dll"; DestDir: "{app}"; Flags: ignoreversion
79+
Source: "../build/windows/x64/runner/Release/msvcp140_2.dll"; DestDir: "{app}"; Flags: ignoreversion
80+
Source: "../build/windows/x64/runner/Release/pdfium.dll"; DestDir: "{app}"; Flags: ignoreversion
81+
Source: "../build/windows/x64/runner/Release/pdfrx.dll"; DestDir: "{app}"; Flags: ignoreversion
82+
Source: "../build/windows/x64/runner/Release/permission_handler_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
83+
Source: "../build/windows/x64/runner/Release/share_plus_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
84+
Source: "../build/windows/x64/runner/Release/url_launcher_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
85+
Source: "../build/windows/x64/runner/Release/vcruntime140.dll"; DestDir: "{app}"; Flags: ignoreversion
86+
Source: "../build/windows/x64/runner/Release/vcruntime140_1.dll"; DestDir: "{app}"; Flags: ignoreversion
87+
Source: "../build/windows/x64/runner/Release/WebView2Loader.dll"; DestDir: "{app}"; Flags: ignoreversion
88+
Source: "../build/windows/x64/runner/Release/data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
89+
90+
[Icons]
91+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
92+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
93+
94+
[Run]
95+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
96+

0 commit comments

Comments
 (0)