Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows inno build failure when using setup_icon_file #228

Open
AminBhst opened this issue Oct 18, 2024 · 1 comment
Open

Windows inno build failure when using setup_icon_file #228

AminBhst opened this issue Oct 18, 2024 · 1 comment

Comments

@AminBhst
Copy link

AminBhst commented Oct 18, 2024

Hello.
The setup_icon_file property is nowhere to be found in the documentation but I did find a merge request that added this property.
Here is my make_config.yaml

app_id: 5B599538-42B1-4826-A479-AF079F21A65D
publisher: Amin Beheshti
publisher_url: https://github.com/AminBhst/brisk
display_name: Brisk
create_desktop_icon: true
install_dir_name: "{autopf}\\Brisk"
setup_icon_file: assets\\icons\\logo.ico
locales:
  - en

After running the workflow with the setup_icon_file set, it results in a build failure:

 Preparing Setup program executable
   Updating icons (SETUP.E32)
Error on line 15 in D:\a\brisk\brisk\dist\1.4.6+15\brisk-1.4.6+15-windows-setup_exe.iss: The system cannot find the path specified.
Compile aborted.
MakeError
#0      AppPackageMakerExe._make (package:flutter_app_packager/src/makers/exe/app_package_maker_exe.dart:49:7)
<asynchronous suspension>
#1      FlutterDistributor.package (package:flutter_distributor/src/flutter_distributor.dart:182:35)
<asynchronous suspension>
#2      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>

Unhandled exception:
MakeError
#0      AppPackageMakerExe._make (package:flutter_app_packager/src/makers/exe/app_package_maker_exe.dart:49:7)
<asynchronous suspension>
#1      FlutterDistributor.package (package:flutter_distributor/src/flutter_distributor.dart:182:35)
<asynchronous suspension>
#2      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>

The exe is built eventually, however, the file is corrupted as it failed during the build. The crazy thing is that the icon is properly set for the corrupted exe file.
It does work fine if I set the path explicitly like this: setup_icon_file: D:\\a\\brisk\\brisk\\assets\\icons\\logo.ico. However, this is obviously not ideal. Is there any way to use ${{ github.workspace }} for flutter distributor?

@AminBhst
Copy link
Author

AminBhst commented Oct 18, 2024

My current workaround is to add a job step that replaces the icon path to the proper explicit value:

make_config.yaml:

app_id: 5B599538-42B1-4826-A479-AF079F21A65D
publisher: Amin Beheshti
publisher_url: https://github.com/AminBhst/brisk
display_name: Brisk
create_desktop_icon: true
install_dir_name: "{autopf}\\Brisk"
setup_icon_file: PLACEHOLDER_ICON_PATH
locales:
  - en

This step added to the workflow file:

      - name: Set proper icon path
        run: |
          $iconPath = "${{ github.workspace }}\\assets\\icons\\logo.ico"
          (Get-Content windows/packaging/exe/make_config.yaml) -replace 'PLACEHOLDER_ICON_PATH', $iconPath | Set-Content windows/packaging/exe/make_config.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant