{"id":22962382,"url":"https://github.com/zonble/flutter_wix_installer_example","last_synced_at":"2025-04-19T12:16:34.037Z","repository":{"id":45479718,"uuid":"437346154","full_name":"zonble/flutter_wix_installer_example","owner":"zonble","description":"Demonstrate how to use WiX to create an installer for Flutter Windows app","archived":false,"fork":false,"pushed_at":"2021-12-15T09:40:42.000Z","size":40644,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T07:41:47.643Z","etag":null,"topics":["flutter","installer","windows","wix"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zonble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-11T17:28:08.000Z","updated_at":"2024-01-05T22:33:37.000Z","dependencies_parsed_at":"2022-07-15T03:30:31.328Z","dependency_job_id":null,"html_url":"https://github.com/zonble/flutter_wix_installer_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2Fflutter_wix_installer_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2Fflutter_wix_installer_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2Fflutter_wix_installer_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2Fflutter_wix_installer_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonble","download_url":"https://codeload.github.com/zonble/flutter_wix_installer_example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249692544,"owners_count":21311404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","installer","windows","wix"],"created_at":"2024-12-14T19:16:39.399Z","updated_at":"2025-04-19T12:16:34.009Z","avatar_url":"https://github.com/zonble.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiX Installer for Flutter App Example\n\n2921 (c) Weizhong Yang a.k.a zonble\n\n![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n![Flutter](https://img.shields.io/badge/Flutter-%2302569B.svg?style=for-the-badge\u0026logo=Flutter\u0026logoColor=white)\n\nDemonstrate how to use [WiX toolset](https://wixtoolset.org/) to create an\ninstaller for Flutter Windows app.\n\nGreat artists ship, so do developers. Once you build a Windows app using\nFlutter, the next step is to distribute your app to your testers and users.\nThere are dozens of tools to let you create installers on Windows, and we use\nWix toolset here.\n\n## Requirement\n\n- A computer running Windows, and Flutter development tools installed, such as\n  Flutter runtime, Visual Studio, and Flutter IDE like Android Studio, Visual\n  Studio Code or IntelliJ. We assume that you are using Visual Studio 2019.\n- Wix toolset installed. [Download link](https://github.com/wixtoolset/wix3/releases/).\n  We assume you install WiX toolkit v3.11.2 at `C:\\Program Files (x86)\\WiX Toolset v3.11`.\n\n## Getting Started\n\nTo see how to build an installer for the example flutter app, just run\n`build_windows.bat` in the Terminal app.\n\nBuilding a Windows installer could be a difficult task. An installer for a\nFLutter app does not merely copy the files compiles by the `flutter build windows`\ncommand, but also creates desktop and start menu shortcut, installs\ndependencies, drivers, and so on. The installer should be also able to know\nabout system requirement, since Flutter Windows app could only run on 64 bit\nWindows system.\n\nSince Flutter app are built on C++ runtime on Windows, you have to distribute a\ncopy of C++ runtime with your Flutter app. Your app may have other dependencies\nas well. If your app uses packages like\n[webview_windows](https://pub.dev/packages/webview_windows) or\n[desktop_webview_window](https://pub.dev/packages/desktop_webview_window), the\ninstaller also has to install Microsoft's [WebView2\nruntime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). To\nbuild such a complex installer, we can use WiX, a powerful toolset.\n\nThere are two step to build our final product, to build an MSI file, and a\nbootstrap bundle, and they are declared in two files in the project,\n[MSI.wxs](https://github.com/zonble/flutter_wix_installer_example/blob/main/installer/wix/MSI/MSI.wxs) and\n[Bundle.wxs](https://github.com/zonble/flutter_wix_installer_example/blob/main/installer/wix/Bundle/Bundle.wxs).\nThe MSI file does the task to copy the binaries to users' computers, while the\nbootstrap bundle combines a set of installers, including our MSI file, C++\nruntime and other dependencies.\n\nYou can use editors like VisualStudio Code to edit the files. Plug-ins like\n[XML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml) and\n[UUID Generator](https://marketplace.visualstudio.com/items?itemName=motivesoft.vscode-uuid-generator)\ncould make you to edit the files easier.\n\n### MSI.wxs\n\nThe file demonstrate how to\n\n- Copy files to users' computers.\n- Create desktop shortcut.\n- Create start menu shortcut.\n- Write install folder to registry.\n\nWhen starting working with the file, please change the name of the product an\nmanufacture to your app and your company, and then generate new UUID for each\ncomponent.\n\nYou may need to take care on the installation scope, you can choose to install\nyour app to each users app data folder, or machine wide program files folder by\nchanging the value of \"InstallScope\" to \"perUser\" or \"perMachine\". You also need\nto change the path of the registry to \"HKCU\" or \"HKLM\" accordingly.\n\nOnce you add new plugins and new assets, you need to edit the file to include\nthe added files.\n\n### Bundle.wxs\n\nThe example demonstrates how to install our MSI file and C++ runtime in a single\nbundle. If you want to install WebView2 runtime with your Flutter app, you can\nadd the following lines as a fragment to the file.\n\n```xml\n\u003cFragment\u003e\n    \u003cPackageGroup Id=\"WebView2\"\u003e\n        \u003cExePackage Id=\"DownloadAndInvokeBootstrapper\" Name=\"Install Microsoft WebView2 Runtime\" Cache=\"no\" Compressed=\"no\" PerMachine=\"yes\" Vital=\"no\" DownloadUrl=\"https://go.microsoft.com/fwlink/p/?LinkId=2124703\" SourceFile=\"..\\..\\MicrosoftEdgeWebView2RuntimeInstallerX64.exe\" InstallCommand=\" /silent /install\" InstallCondition=\"NOT (REMOVE OR WVRTInstalled)\"\u003e\n            \u003cRemotePayload ProductName=\"MicrosoftEdgeWebview2Setup\" Description=\"Microsoft Edge WebView2 Update Setup\" CertificatePublicKey=\"1392A8505C3B192F62311EA9005E49C1B5358F6B\" Hash=\"82B42348804E8D82C773DC3391B691712BB1B388\" Size=\"1815832\" Version=\"1.3.135.41\" /\u003e\n        \u003c/ExePackage\u003e\n\u003cExePackage Id=\"DownloadAndInvokeBootstrapper\" Name=\"Install Microsoft WebView2 Runtime\" Cache=\"no\" Compressed=\"yes\" PerMachine=\"yes\" Vital=\"no\" SourceFile=\"..\\..\\MicrosoftEdgeWebView2RuntimeInstallerX64.exe\" InstallCommand=\" /silent /install\" InstallCondition=\"NOT (REMOVE OR WVRTInstalled)\" /\u003e\n\u003c/PackageGroup\u003e\n```\n\nAnd update the installation chain\n\n```xml\n\u003cChain DisableSystemRestore=\"yes\"\u003e\n    \u003cPackageGroupRef Id=\"VCRuntime\" /\u003e\n    \u003cPackageGroupRef Id=\"WebView2\" /\u003e\n    \u003cPackageGroupRef Id=\"InstallerPackages\" /\u003e\n\u003c/Chain\u003e\n```\n\n## License\n\nThe example is released under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fflutter_wix_installer_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonble%2Fflutter_wix_installer_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fflutter_wix_installer_example/lists"}