File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ let getFilesAsWiXString files =
53
53
|> toLines
54
54
55
55
/// Creates recursive WiX directory and file tags from the given DirectoryInfo
56
+ /// The function will create one component for each file [best practice](https://support.microsoft.com/de-de/kb/290997/en-us)
57
+ /// and set the GUID to "*", which will make WiX produce consistent Component Guids if the Component's target path doesn't change.
58
+ /// This is vital for major upgrades, since windows installer needs a consistent component guid for tracking each of them.
59
+ /// You can use the getComponentIdsFromWiXString function for getting all created component refs and adding them to features.
56
60
let rec wixDir fileFilter asSubDir ( directoryInfo : DirectoryInfo ) =
57
61
let dirs =
58
62
directoryInfo
@@ -70,8 +74,9 @@ let rec wixDir fileFilter asSubDir (directoryInfo : DirectoryInfo) =
70
74
let compo =
71
75
if files = " " then " "
72
76
else
73
- sprintf " <Component Id=\" %s \" Guid=\" %s \" >\r\n %s \r\n </Component>\r\n " ( compName directoryInfo.Name)
74
- ( Guid.NewGuid() .ToString()) files
77
+ split '\n' files
78
+ |> Seq.map( fun f -> sprintf " <Component Id=\" %s \" Guid=\" %s \" >\r\n %s \r\n </Component>\r\n " ( compName directoryInfo.Name) " *" f)
79
+ |> toLines
75
80
76
81
if asSubDir then
77
82
sprintf " <Directory Id=\" %s \" Name=\" %s \" >\r\n %s%s \r\n </Directory>\r\n " ( dirName directoryInfo.Name)
You can’t perform that action at this time.
0 commit comments