Skip to content

Commit e9cc65b

Browse files
FEAT: Add app components
1 parent 6a85b72 commit e9cc65b

File tree

4 files changed

+113
-14
lines changed

4 files changed

+113
-14
lines changed

Installer/AppComponents.wxs

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,72 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
22
<Fragment>
3-
<ComponentGroup Id="AppComponents" Directory="INSTALLFOLDER">
3+
<ComponentGroup Id="BaseComponents" Directory="INSTALLFOLDER">
44
<Component>
5-
<File Source="AppComponents.wxs" />
5+
<!-- We wrap single files in components to let the linker generate the GUIDs -->
6+
<File Source="$(FlutterBuildOutputDir)\CastFORM.exe" />
7+
</Component>
8+
<Component>
9+
<File Source="$(FlutterBuildOutputDir)\flutter_windows.dll" />
10+
</Component>
11+
<Component>
12+
<File Source="$(FlutterBuildOutputDir)\pdfium.dll" />
13+
</Component>
14+
<Component>
15+
<File Source="$(FlutterBuildOutputDir)\printing_plugin.dll" />
16+
</Component>
17+
<Component>
18+
<File Source="$(FlutterBuildOutputDir)\url_launcher_windows_plugin.dll" />
19+
</Component>
20+
</ComponentGroup>
21+
22+
<ComponentGroup Id="DataComponents" Directory="DATAFOLDER">
23+
<Component>
24+
<File Source="$(FlutterBuildOutputDir)\data\app.so" />
25+
</Component>
26+
<Component>
27+
<File Source="$(FlutterBuildOutputDir)\data\icudtl.dat" />
28+
</Component>
29+
</ComponentGroup>
30+
31+
<ComponentGroup Id="FlutterAssetComponents" Directory="FLUTTERASSETSFOLDER">
32+
<Component>
33+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\AssetManifest.bin" />
34+
</Component>
35+
<Component>
36+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\AssetManifest.json" />
37+
</Component>
38+
<Component>
39+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\FontManifest.json" />
40+
</Component>
41+
<Component>
42+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\NOTICES.Z" />
43+
</Component>
44+
</ComponentGroup>
45+
46+
<ComponentGroup Id="FontComponents" Directory="FONTSFOLDER">
47+
<Component>
48+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\assets\fonts\RobotoSlab-Regular.ttf" />
49+
</Component>
50+
</ComponentGroup>
51+
52+
<ComponentGroup Id="FormComponents" Directory="FORMTEMPLATESFOLDER">
53+
<Component>
54+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\assets\form_templates\pokemon_decklist_a4.webp" />
55+
</Component>
56+
<Component>
57+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\assets\form_templates\pokemon_decklist_letter.webp" />
58+
</Component>
59+
</ComponentGroup>
60+
61+
<ComponentGroup Id="FlutterFontComponents" Directory="FLUTTERFONTSFOLDER">
62+
<Component>
63+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\fonts\MaterialIcons-Regular.otf" />
64+
</Component>
65+
</ComponentGroup>
66+
67+
<ComponentGroup Id="ShaderComponents" Directory="SHADERSFOLDER">
68+
<Component>
69+
<File Source="$(FlutterBuildOutputDir)\data\flutter_assets\shaders\ink_sparkle.frag" />
670
</Component>
771
</ComponentGroup>
872
</Fragment>

Installer/Installer.wixproj

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
<Project Sdk="WixToolset.Sdk/4.0.3">
2-
</Project>
2+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
3+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
4+
</PropertyGroup>
5+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
6+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
7+
</PropertyGroup>
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
9+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
10+
</PropertyGroup>
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
12+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
13+
</PropertyGroup>
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
15+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
18+
<DefineConstants>FlutterBuildOutputDir=C:\Users\Kooki\Desktop\dev\tcg_tools\CastFORM\build\windows\runner\Release;VisualStudoRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT</DefineConstants>
19+
</PropertyGroup>
20+
</Project>

Installer/Package.wxs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
<Feature Id="Complete">
1212
<Feature Id="Main">
1313
<!-- Flutter output -->
14-
<ComponentGroupRef Id="AppComponents" />
14+
<ComponentGroupRef Id="BaseComponents" />
15+
<ComponentGroupRef Id="DataComponents" />
16+
<ComponentGroupRef Id="FlutterAssetComponents" />
17+
<ComponentGroupRef Id="FontComponents" />
18+
<ComponentGroupRef Id="FormComponents" />
19+
<ComponentGroupRef Id="FlutterFontComponents" />
20+
<ComponentGroupRef Id="ShaderComponents" />
1521
</Feature>
1622
<Feature Id="VCredist">
1723
<!-- VCredist -->

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ WiX supports a number of interfaces including CLI - we decided to go with the Vi
5151

5252
## How To Use SunnyFORM
5353

54-
1. Clone the repository, and open in Visual Studio. Set the build configuration to x64 (required for Flutter).
55-
2. Navigate to `Package.wxs`, and under the `Package`tag, update the version number attribute
54+
1. Run `flutter build windows`, and note CastFORM version
55+
2. Clone the repository, and open in Visual Studio. Set the build configuration to x64 (required for Flutter).
56+
3. In the top toolbar go to `Project > Properties > Build`, and modify the absolute paths for Fluttter build output and Visual C++ Redistributable libraries directories
57+
3. Navigate to `Package.wxs`, and under the `Package`tag, update the version number attribute
58+
4. Check if the the folder structure in `CastFORM/build/windows/runner/Release` has changed, and update `Folders.wxs` accordingly
59+
5. Check if the file structure has changed, and update `AppComponents.wxs` accordingly
5660

5761
## How To Use HeatWave for Flutter Projects
5862

@@ -65,24 +69,31 @@ Note2: These instructions assume system-wide installation, rather than user-only
6569
- If you don't check that last option, you'll end up with a folder structure like so: `.../solution/project/`,
6670
which may be suitable for large projects but unlikely to be necessary for our intents and purposes
6771
- After this you can hit `Create`
68-
2. `Package.wxs` should already be open for you. Modify the `Package` tag with the attributes you'd like to see in the installed app
72+
2. In the top toolbar go to `Project > Properties > Build`, and under `Preprocessor variables` set any user-defined variables you'd like to use
73+
- Refer to our `Installer.wixproj` file for an example
74+
- We use it to house the absolute paths for Fluttter build output and Visual C++ Redistributable libraries directories
75+
3. `Package.wxs` should already be open for you. Modify the `Package` tag with the attributes you'd like to see in the installed app
6976
- E.g. `Name` is how it should be displayed in the Start Menu after installation
7077
- Version should be in the format `major.minor.build`, with the first 2 numbers being 0-255, and the build number being 0-65535
7178
- Upgrade code is a GUID that lets Windows Installer identify different version of the same software
72-
3. Nest the following line within the `Package` tags (see ours for reference): `<MediaTemplate EmbedCab="yes"/>`
79+
4. Nest the following line within the `Package` tags (see ours for reference): `<MediaTemplate EmbedCab="yes"/>`
7380
- This tells WiX to bundle the cabinet files inside of the `.msi` so that you only distribute one file as the installer
74-
4. Create a new `Feature` tag to enclose the existing template feature; create another one in the same level as the along side `Main`. Feel free to name the IDs as you see fit (see ours for reference).
81+
5. Create a new `Feature` tag to enclose the existing template feature; create another one in the same level as the along side `Main`. Feel free to name the IDs as you see fit (see ours for reference).
7582
- The feature tag should now be a tree with one parent and two children
7683
- We are repurposing the feature tag provided for the main application, and creating one in the same level for Visual C++ redistributables
77-
5. Rename all instances of `ExampleComponents` to `AppComponents` in the project
78-
- See `Package.wxs` and `AppComponents.wxs` in ours for reference
79-
6. Duplicate `ComponentGroupRef` tag for the other feature with a suitable ID for Visual C++ Redustributable libraries; similarly duplicate `AppComponents.wxs` and rename IDs to waht you used in the corresponding `ComponentGroupRef` ID
84+
6. Duplicate `ComponentGroupRef` tag for the other feature with a suitable ID for Visual C++ Redustributable libraries; similarly duplicate `ExampleComponents.wxs` and rename IDs to waht you used in the corresponding `ComponentGroupRef` ID
8085
- See `Package.wxs` and `VRredist.wxs` in ours for reference
81-
7. Modify `INSTALLFOLDER` in `Folders.wxs` to suit your preferred install location
86+
7. Use the `ComponentGroupRef` tag to create one component group reference for each folder you'd like to write files to (non-recursive)
87+
- See `Package.wxs` and `AppComponents.wxs` in ours for reference
88+
8. Modify `INSTALLFOLDER` in `Folders.wxs` to suit your preferred install location
8289
- Supplying `ProgramFiles6432Folder` for `StandardDirectory` simply means to use either `C:\Program Files (x86)` or `C:\Program Files` as appropriate depending on build target
8390
- The template created by HeatWave concatenates company name and product name to make one folder; we split this up into a nested folder structure for our use case
84-
8. Specify additional folders nested under `INSTALLFOLDER` according to your Flutter build
91+
9. Specify additional folders nested under `INSTALLFOLDER` according to your Flutter build
8592
- Refer to `build/windows/runner/Release` after running `flutter build windows` in your Flutter project
93+
10. Flesh out application component groups - see our `AppComponents.wxs` for reference
94+
- To use preprocessor variables, see step 2
95+
11. Repeat for Visual C++ Redustributable libraries
96+
- See our `VRredist.wxs` for reference
8697

8798
## Disclaimer
8899

0 commit comments

Comments
 (0)