msix 2.8.1 msix: ^2.8.1 copied to clipboard
A command-line tool that create Msix installer from your flutter windows-build files.
Msix #
A command-line tool that create Msix installer from your flutter windows-build files.
📋 Install #
In your pubspec.yaml
, add msix
as a new dependency:
dev_dependencies:
flutter_test:
sdk: flutter
msix: ^2.8.1
📦 Create Msix #
Run the commands:
PS c:\src\flutter_project\> flutter build windows
PS c:\src\flutter_project\> flutter pub run msix:create
The flutter build windows
is required to build the executable that
flutter pub run msix:create
bundles up in the MSIX install file.
⚙ Configuration (Optional) #
This package have default configuration values, but you can configure it to suit your needs by adding msix_config:
at the end of your pubspec.yaml
file:
msix_config:
display_name: MyAppName
publisher_display_name: MyName
identity_name: MyCompany.MySuite.MyApp
msix_version: 1.0.0.0
logo_path: C:\<PathToIcon>\<Logo.png>
capabilities: "internetClient,location,microphone,webcam"
See full list of available configurations (Click to expand)
Configuration Name & CLI Arg/Flag |
Description (from microsoft docs) | Example |
---|---|---|
display_name--display-name -d |
A friendly name that can be displayed to users. | MyAppName |
logo_path--logo-path -l |
Path to the app logo. recommended minimum size of 400px on 400px see supported formats |
C:/<PathToIcon>/<Logo.png> |
msix_version--version -v |
The version number of the package. | 1.0.0.0 (must be this format) |
store--store |
The installer (.msix) is for publish to Windows Store | false |
publisher_display_name--publisher-display-name -u |
A friendly name for the publisher that can be displayed to users. | MyName |
identity_name--identity-name -i |
Defines a globally unique identifier for a package. | com.flutter.MyApp |
publisher--publisher -b |
Describes the publisher information. | CN=BF212345-5644-46DF-8668-014044C1B138 |
output_path--output-path -o |
The location to create the .msix file | C:\Users\me\Desktop\New folder\ |
output_name--output-name -n |
The name of the created .msix file | myApp_dev |
assets_directory_path--assets-directory-path -a |
Path to assets folder (.dll files) to include in the installer | C:\<PathToFolder>\myAssets |
languages--languages |
Declares a language for resources contained in the package | en-us, ja-jp |
capabilities--capabilities -e |
List of the capabilities the application requires. see full capabilities list |
internetClient,location,microphone,bluetooth,webcam |
architecture--architecture -h |
Describes the architecture of the code contained in the package, one of:x86 , x64 , arm , neutral |
x64 |
certificate_path--certificate-path -c |
Path to your certificate file | C:/<PathToCertificate>/<MyCertificate.pfx> |
certificate_password--certificate-password -p |
The certificate password | 1234 |
signtool_options--signtool-options |
Signtool use the syntax: [command] [options] [file_name], so you can provide here the [options] part, see full documentation this overwriting the fields: certificate_path , certificate_password |
/v /fd SHA256 /f C:/Users/me/Desktop/my.cer |
dont_install_cert--dont-install-certificate |
if true , the package won't try to install the certificate |
false |
file_extension--file-extension -f |
File extensions that the app will used to open | .txt, .myFile, .test1 |
protocol_activation--protocol-activation |
Protocol activation that will open the app | http |
add_execution_alias--add-execution-alias |
Start your application by using an alias. the alias is the application name: from the pubspec.yaml |
true |
--debug-signing |
Showing more information about the certificate |
✒️ Signing Options #
.msix installer must be sign with certificate (.pfx)
- this package will automatically sign your app with build in test certificate.
- if you publish your app to the Windows Store, the app will automatically sign by the store.
- if you need to use your own certificate, use the configuration fields:
certificate_path, certificate_password
Note: by default, this package will install the certificate on your machine, you can disable it by using the --dontInstallCert
flag or the configuration: dont_install_cert: true
Windows Store #
To generate msix file for publish to the Windows Store, use the --store
flag or add store: true
in msix configuration section in your pubspec.yaml
.
Note:
For Windows Store publication the configuration values: publisher_display_name
, identity_name
, msix_version
, publisher
must be valid,
you can find those values in your windows store dashboard (Product
> Product identity
) see image.
For more information about publish to the Windows Store see: How to publish your MSIX package to the Microsoft Store
📁 .dll Files And Assets (FFI Library) #
To include your .dll and other third party assets in your msix installer, you can use the configuration:
assets_directory_path: 'C:\Users\me\flutter_project_name\myAssets'
- create new folder in your root project folder (where
pubspec.yaml
is located) - put there all your assets (.dll etc.)
- in your application code, use the FFI package like so:
var helloLib = ffi.DynamicLibrary.open('myAssets/hello.dll');
var helloLib2 = ffi.DynamicLibrary.open('myAssets/subFolder/hello2.dll');
//Note: ---> DONT <--- use absolute path:
var absolutePath = path.join(Directory.current.path, 'myAssets/hello.dll');
var helloLib = ffi.DynamicLibrary.open(absolutePath);
Tags: msi
windows
win10
win11
windows10
windows11
windows store
windows installer
windows packaging
appx
AppxManifest
SignTool
MakeAppx