我正在查看一些来自 installshield msi 文件的 dark.exe 反编译输出的语句。
一个部分,例如:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Component Id="UHDDriver_Dir" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="UHDDRIVER" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
想知道我是否可以CreateFolder
按如下方式优化标签:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
请注意,我删除了组件 IDUHDDriver_Dir
并将其替换CreateFolder
为第一个组件中的标签,认为空CreateFolder
只是对最后一个已知Directory
标签进行操作 - 对吗?我可以安装/卸载以删除该组件,还是我需要为我创建的每个目录定义一个组件和 guid?
我在这里还缺少其他优化吗?