github.com/goreleaser/goreleaser@v1.25.1/www/docs/customization/msi.md (about)

     1  # MSI
     2  
     3  > Since: v1.24 pro
     4  
     5  !!! success "GoReleaser Pro"
     6  
     7      The msi feature is available only in [GoReleaser Pro feature](/pro/).
     8  
     9  GoReleaser can create MSI installers for windows binaries using [msitools][].
    10  
    11  The `msi` section specifies how the **installers** should be created:
    12  
    13  ```yaml
    14  # .goreleaser.yaml
    15  msi:
    16    - # ID of the resulting installer.
    17      #
    18      # Default: the project name
    19      id: foo
    20  
    21      # Filename of the installer (without the extension).
    22      #
    23      # Default: '{{.ProjectName}}_{{.MsiArch}}'
    24      # Templates: allowed
    25      name: "myproject-{{.MsiArch}}"
    26  
    27      # The WXS file used to create the installers.
    28      # The file contents go through the templating engine, so you can do things
    29      # like `{{.Version}}` inside of it.
    30      #
    31      # Templates: allowed
    32      # Required.
    33      wxs: ./windows/app.wsx
    34  
    35      # IDs of the archives to use.
    36      # Empty means all IDs.
    37      ids:
    38        - foo
    39        - bar
    40  
    41      # GOAMD64 to specify which amd64 version to use if there are multiple
    42      # versions from the build section.
    43      #
    44      # Default: v1
    45      goamd64: v1
    46  
    47      # More files that will be available in the context in which the installer
    48      # will be built.
    49      extra_files:
    50        - logo.ico
    51  
    52      # Whether to remove the archives from the artifact list.
    53      # If left as false, your end release will have both the zip and the msi
    54      # files.
    55      replace: true
    56  
    57      # Set the modified timestamp on the output installer, typically
    58      # you would do this to ensure a build was reproducible.
    59      # Pass an empty string to skip modifying the output.
    60      #
    61      # Templates: allowed.
    62      mod_timestamp: "{{ .CommitTimestamp }}"
    63  ```
    64  
    65  On Windows, it'll try to use the `candle` and `light` binaries from the
    66  [Wix Toolkit][wix] instead.
    67  
    68  Here's an example `wsx` file that you can build upon:
    69  
    70  ```xml
    71  <?xml version='1.0' encoding='windows-1252'?>
    72  <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
    73  	<Product
    74  		Name='{{.ProjectName}} {{.Version}}'
    75  		Id='ABCDDCBA-86C7-4D14-AEC0-86413A69ABDE'
    76  		UpgradeCode='ABCDDCBA-7349-453F-94F6-BCB5110BA8FD'
    77  		Language='1033'
    78  		Codepage='1252'
    79  		Version='{{.Version}}'
    80  		Manufacturer='My Company'>
    81  
    82  		<Package
    83  			Id='*'
    84  			Keywords='Installer'
    85  			Description="{{.ProjectName}} installer"
    86  			Comments=''
    87  			Manufacturer='My Company'
    88  			InstallerVersion='200'
    89  			Languages='1033'
    90  			Compressed='yes'
    91  			SummaryCodepage='1252'
    92  		/>
    93  
    94  		<Media
    95  			Id='1'
    96  			Cabinet='Sample.cab'
    97  			EmbedCab='yes'
    98  			DiskPrompt="CD-ROM #1"
    99  		/>
   100  
   101  		<Property
   102  			Id='DiskPrompt'
   103  			Value="{{.ProjectName}} {{.Version}} Installation [1]"
   104  		/>
   105  
   106  		<Directory Id='TARGETDIR' Name='SourceDir'>
   107  			<Directory Id='ProgramFiles{{ if eq .Arch "amd64" }}64{{ end }}Folder' Name='PFiles'>
   108  				<Directory Id='{{.ProjectName}}' Name='{{.ProjectName}}'>
   109  					<Component
   110  						Id='MainExecutable'
   111  						Guid='ABCDDCBA-83F1-4F22-985B-FDB3C8ABD474'
   112  					>
   113  						<File
   114  							Id='{{.Binary}}.exe'
   115  							Name='{{.Binary}}.exe'
   116  							DiskId='1'
   117  							Source='{{.Binary}}.exe'
   118  							KeyPath='yes'
   119  						/>
   120  					</Component>
   121  				</Directory>
   122  			</Directory>
   123  		</Directory>
   124  
   125  		<Feature Id='Complete' Level='1'>
   126  			<ComponentRef Id='MainExecutable' />
   127  		</Feature>
   128  	</Product>
   129  </Wix>
   130  ```
   131  
   132  ## Limitations
   133  
   134  1. Some options available in the [Wix Toolset][wix] won't work with
   135     [msitools][], run a snapshot build and verify the generated installers.
   136  1. Only `amd64` and `386` are supported.
   137  
   138  !!! tip
   139  
   140      Learn more about the [name template engine](/customization/templates/).
   141  
   142  [msitools]: https://wiki.gnome.org/msitools
   143  [wix]: https://wixtoolset.org