File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -176,18 +176,29 @@ def create_wix_files(input_dir, version):
176
176
# Create a components file with proper directory structure for WiX 4
177
177
# Use forward slashes for paths to avoid escaping issues
178
178
input_dir_forward = input_dir .replace ('\\ ' , '/' )
179
+
180
+ # Get a list of all files in the directory except GetDistGUI.exe
181
+ files = []
182
+ for file in os .listdir (input_dir ):
183
+ if file != "GetDistGUI.exe" and os .path .isfile (os .path .join (input_dir , file )):
184
+ files .append (file )
185
+
186
+ # Create component entries for each file
187
+ file_components = ""
188
+ for i , file in enumerate (files ):
189
+ file_id = f"File{ i + 1 } "
190
+ file_components += f"""
191
+ <Component Id="Component{ i + 1 } " Guid="*">
192
+ <File Id="{ file_id } " Source="{ input_dir_forward } /{ file } " KeyPath="yes" />
193
+ </Component>"""
194
+
179
195
components_content = f"""<?xml version="1.0" encoding="UTF-8"?>
180
196
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
181
197
<Fragment>
182
198
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
183
199
<Component Id="MainExecutable" Guid="*">
184
200
<File Id="GetDistGUIEXE" Source="{ input_dir_forward } /GetDistGUI.exe" KeyPath="yes" />
185
- </Component>
186
-
187
- <!-- Add a component for each file in the directory -->
188
- <Component Id="AppFiles" Guid="*">
189
- <File Source="{ input_dir_forward } /*" Exclude="GetDistGUI.exe" />
190
- </Component>
201
+ </Component>{ file_components }
191
202
</ComponentGroup>
192
203
</Fragment>
193
204
</Wix>
You can’t perform that action at this time.
0 commit comments