Skip to content

Commit 7cfa174

Browse files
authored
Add version to windows-msi filename (#107)
1 parent cc367e5 commit 7cfa174

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmd/packaging/packaging.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,15 @@ type packagingTask struct {
107107
buildOutputDirectory string // Path to copy the build output of the app to. Operates in the temporary directory
108108
packagingScriptTemplate string // Template for the command that actually packages the app
109109
outputFileExtension string // File extension of the packaged app
110-
outputFileContainsVersion bool // Whether the output file name contains the version
111-
outputFileUsesApplicationName bool // Uses the application name instead of the package name
112-
skipAssertInitialized bool // Set to true when a task doesn't need to be initialized.
110+
// NOTE: outputFileContainsVersion is currently always true, we could
111+
// consider adding a flag for it to let users disable it.
112+
outputFileContainsVersion bool // Whether the output file name contains the version
113+
// NOTE: outputFileUsesApplicationName is always true for darwin-* and
114+
// windows-*, and always false for linux-*. We could consider adding a flag
115+
// for it to enable and disable at will (defaulting to how it's currently
116+
// configured).
117+
outputFileUsesApplicationName bool // Uses the application name instead of the package name
118+
skipAssertInitialized bool // Set to true when a task doesn't need to be initialized.
113119
}
114120

115121
func (t *packagingTask) Name() string {

cmd/packaging/windows-msi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ var WindowsMsiTask = &packagingTask{
2020
"windows-msi/app.wxs.tmpl": "{{.packageName}}.wxs.tmpl",
2121
},
2222
buildOutputDirectory: "build",
23-
packagingScriptTemplate: "convert -resize x16 build/assets/icon.png build/assets/icon.ico && wixl -v {{.packageName}}.wxs && mv -n {{.packageName}}.msi \"{{.applicationName}}.msi\"",
23+
packagingScriptTemplate: "convert -resize x16 build/assets/icon.png build/assets/icon.ico && wixl -v {{.packageName}}.wxs && mv -n {{.packageName}}.msi \"{{.applicationName}} {{.version}}.msi\"",
2424
outputFileExtension: "msi",
25-
outputFileContainsVersion: false,
25+
outputFileContainsVersion: true,
2626
outputFileUsesApplicationName: true,
2727
generateBuildFiles: func(packageName, tmpPath string) {
2828
directoriesFilePath, err := filepath.Abs(filepath.Join(tmpPath, "directories.wxi"))

0 commit comments

Comments
 (0)