Skip to content

Commit

Permalink
Merge pull request leanflutter#74 from ueki-tomohiro/add-start-up
Browse files Browse the repository at this point in the history
add config option in exe
  • Loading branch information
lijy91 authored May 25, 2022
2 parents 5467acf + 5e9231c commit df55859
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ WizardStyle=modern
{% for locale in LOCALES %}
{% if locale == 'en' %}Name: "english"; MessagesFile: "compiler:Default.isl"{% endif %}
{% if locale == 'zh' %}Name: "chinesesimplified"; MessagesFile: "compiler:Languages\\ChineseSimplified.isl"{% endif %}
{% if locale == 'ja' %}Name: "japanese"; MessagesFile: "compiler:Languages\\Japanese.isl"{% endif %}
{% endfor %}
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: {% if CREATE_DESKTOP_ICON != true %}unchecked{% else %}checkedonce{% endif %}
Name: "launchAtStartup"; Description: "{cm:AutoStartProgram,{{DISPLAY_NAME}}}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: {% if LAUNCH_AT_STARTUP != true %}unchecked{% else %}checkedonce{% endif %}
[Files]
Source: "{{SOURCE_DIR}}\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\\{{APP_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"
Name: "{autodesktop}\\{{APP_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; Tasks: desktopicon
Name: "{userstartup}\\{{APP_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; WorkingDir: "{app}"; Tasks: launchAtStartup
[Run]
Filename: "{app}\\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: nowait postinstall skipifsilent
""";
Expand Down Expand Up @@ -67,6 +68,7 @@ class InnoSetupScript {
'PUBLISHER_NAME': makeConfig.publisherName,
'PUBLISHER_URL': makeConfig.publisherUrl,
'CREATE_DESKTOP_ICON': makeConfig.createDesktopIcon,
'LAUNCH_AT_STARTUP': makeConfig.launchAtStartup,
'INSTALL_DIR_NAME':
makeConfig.installDirName ?? makeConfig.defaultInstallDirName,
'SOURCE_DIR': makeConfig.sourceDir,
Expand Down
4 changes: 4 additions & 0 deletions packages/app_package_maker_exe/lib/src/make_exe_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class MakeExeConfig extends MakeConfig {
String? publisherName;
String? publisherUrl;
bool? createDesktopIcon;
bool? launchAtStartup;
String? installDirName;
List<String>? locales;

Expand All @@ -35,6 +36,7 @@ class MakeExeConfig extends MakeConfig {
this.publisherName,
this.publisherUrl,
this.createDesktopIcon,
this.launchAtStartup,
this.installDirName,
this.locales,
});
Expand All @@ -51,6 +53,7 @@ class MakeExeConfig extends MakeConfig {
publisherName: json['publisher_name'] ?? json['appPublisher'],
publisherUrl: json['publisher_url'] ?? json['appPublisherUrl'],
createDesktopIcon: json['create_desktop_icon'],
launchAtStartup: json['launch_at_startup'],
installDirName: json['install_dir_name'],
locales: locales,
);
Expand All @@ -67,6 +70,7 @@ class MakeExeConfig extends MakeConfig {
'publisher_name': publisherName,
'publisher_url': publisherUrl,
'create_desktop_icon': createDesktopIcon,
'launch_at_startup': launchAtStartup,
'install_dir_name': installDirName,
'locales': locales,
}..removeWhere((key, value) => value == null);
Expand Down

0 comments on commit df55859

Please sign in to comment.