Flutter Inno Setup

使用 Inno Setup 为 Flutter 和原生 Dart 应用程序制作 Windows 安装程序。

安装

运行此命令

使用 Dart

dart pub add -d innosetup

使用 Flutter

flutter pub add -d innosetup

简单用法

InnoSetup(
  app: InnoSetupApp(
    name: 'Test App',
    version: Version.parse('0.1.0'),
    publisher: 'author',
    urls: InnoSetupAppUrls(
      homeUrl: Uri.parse('https://example.com/'),
    ),
  ),
  files: InnoSetupFiles(
    executable: File('build/windows/runner/test_app.exe'),
    location: Directory('build/windows/runner'),
  ),
  name: const InnoSetupName('windows_installer'),
  location: InnoSetupInstallerDirectory(
    Directory('build/windows'),
  ),
  icon: InnoSetupIcon(
    File('assets/icon.ico'),
  ),
).make();

高级用法

InnoSetup(
  name: const InnoSetupName(
    'windows_installer',
  ),
  app: InnoSetupApp(
    name: 'Test App',
    version: Version.parse('0.1.0'),
    publisher: 'author',
    urls: InnoSetupAppUrls(
      homeUrl: Uri.parse('https://example.com/home'),
      publisherUrl: Uri.parse('https://example.com/author'),
      supportUrl: Uri.parse('https://example.com/support'),
      updatesUrl: Uri.parse('https://example.com/updates'),
    ),
  ),
  files: InnoSetupFiles(
    executable: File('build/windows/runner/test_app.exe'),
    location: Directory('build/windows/runner'),
  ),
  location: InnoSetupInstallerDirectory(
    Directory('build/windows'),
  ),
  icon: InnoSetupIcon(
    File('assets/icon.ico'),
  ),
  runAfterInstall: false,
  compression: InnoSetupCompressions().lzma2(
    InnoSetupCompressionLevel.ultra64,
  ),
  languages: InnoSetupLanguages().all,
  license: InnoSetupLicense(
    File('LICENSE'),
  ),
).make();

来源

git clone https://github.com/aswinmurali-io/flutter_innosetup.git
cd flutter_innosetup
dart pub get

GitHub

查看 Github