Skip to content

Commit

Permalink
add NeverOverwrite + Permanent to file config
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Mar 7, 2022
1 parent 82be605 commit 7297635
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions manifest/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ type Info struct {

// File is the struct to decode a file.
type File struct {
ID int `json:"-"`
Path string `json:"path,omitempty"`
Service *Service `json:"service,omitempty"`
ID int `json:"-"`
Path string `json:"path,omitempty"`
Service *Service `json:"service,omitempty"`
NeverOverwrite bool `json:"never_overwrite,omitempty"`
Permanent bool `json:"permanent,omitempty"`
}

// Directory stores a list of files and a list of sub-directories.
Expand Down
2 changes: 1 addition & 1 deletion manifest/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestBuilDirectories(t *testing.T) {
func TestBuildDirectories(t *testing.T) {
wixFile := &WixManifest{}
wixFile.Directories = []Directory{
{
Expand Down
7 changes: 6 additions & 1 deletion templates/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
<Directory Id="INSTALLDIR" Name="{{.Product}}">
{{define "FILES"}}
{{range $f := .}}
<Component Id="ApplicationFiles{{$f.ID}}" Guid="*">
<Component
Id="ApplicationFiles{{$f.ID}}"
Guid="*"
Permanent="{{if $f.Permanent}}yes{{else}}no{{end}}"
NeverOverwrite="{{if $f.NeverOverwrite}}yes{{else}}no{{end}}">

<File Id="ApplicationFile{{$f.ID}}" Source="{{$f.Path}}"/>
{{if $f.Service}}
<ServiceInstall Id="ServiceInstall{{$f.ID}}" Type="ownProcess" Name="{{$f.Service.Name}}" Start="{{$f.Service.Start}}" Account="LocalSystem" ErrorControl="normal"
Expand Down

0 comments on commit 7297635

Please sign in to comment.