我正在将我的一个项目从旧的vdproj迁移到WIX项目。 在我的应用程序安装中,我必须在安装完成的自定义操作期间完成一些工作。我成功地能够做其他工作,但sqllite相关的实现不起作用,因为SQLite.Interop.dll文件没有复制到应用程序安装的临时文件夹中。 Bu安装完成后,SQLite.interop文件可以与程序菜单文件夹中的其他文件一起复制。
My Wix setup xml如下:
...
<Feature Id="ProductFeature" Title="MyAppPosWixSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="en_US_files" />
<ComponentGroupRef Id="Images_files" />
<ComponentGroupRef Id="_x64_files" />
<ComponentGroupRef Id="_x86_files" />
<ComponentGroupRef Id="ProgramFilesFolder_files" />
<ComponentGroupRef Id="dlls_files" />
</Feature>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MyAppPosWixSetup">
<Directory Id="Images" Name="Images" />
<Directory Id="_x64" Name="x64" />
<Directory Id="_x86" Name="x86" />
<Directory Id="en_US" Name="en-US" />
<Directory Id="dlls" Name="dlls" />
</Directory>
</Directory>
<Directory Id='AppDataFolder' Name='Roaming'>
<Directory Id='_8F59BFDE_678A_D04A_B032_C90D66940878' Name='MyApp POS'>
<Component Id='com_dir_8F59BFDE_678A_D04A_B032_C90D66940878' Guid='EECDB3BC-65C4-4A73-A182-2976A649713E' Transitive='no'>
<CreateFolder Directory='_8F59BFDE_678A_D04A_B032_C90D66940878' />
<RemoveFolder Id='_F53B4A9B_E7AA_4C30_A42F_DDF464B4A795' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]\Installer' Name='com_dir_8F59BFDE_678A_D04A_B032_C90D66940878' Type='string' Value='MyApp POS directory' KeyPath='yes' />
</Component>
<Component Id='com_B81229DC_FAC4_654D_B049_EC75EA79F23E' Guid='55A50D8C-2310-45A4-B8BF-54597EEE5B12' Permanent='no' SharedDllRefCount='no' Transitive='no'>
<File Id='_B81229DC_FAC4_654D_B049_EC75EA79F23E' DiskId='1' Hidden='no' ReadOnly='no' System='no' Vital='yes' Compressed='yes' Name='config.ini' Source='..\PosControlApplication\config.ini' KeyPath='no' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]\Installer' Name='com_B81229DC_FAC4_654D_B049_EC75EA79F23E' Type='string' Value='config.ini file' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id='DesktopFolder' Name='Desktop'>
<Component Id='com_dirDesktopFolder' Guid='064DDC54-0010-43F3-BCF3-8DCB8F9A0A87' Transitive='no'>
<RemoveFolder Id='_FB2AC228_7D57_4311_9C65_34E7A5C1B266' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]\Installer' Name='com_dirDesktopFolder' Type='string' Value='Desktop directory' KeyPath='yes' />
<Shortcut Id='_3DFA2BA1_17C7_0445_9809_A24D46646F71' Name='MyApp POS' Show='normal' WorkingDirectory='TARGETDIR' Target='[INSTALLFOLDER]PosControlApplication.exe'>
<Icon Id='_A24D46646F71' SourceFile='..\PosControlApplication\Images\MyApp logo.ico' />
</Shortcut>
</Component>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="_x64_files" Directory="_x64">
<Component Id="x64_SQLite.Interop.dll" Guid="13b928df-a28e-4163-af38-5cd5d87bf644">
<File Id="x64_SQLite.Interop.dll" Name="SQLite.Interop.dll" Source="$(var.PosControlApplication_TargetDir)x64\SQLite.Interop.dll" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="_x86_files" Directory="_x86">
<Component Id="x86_SQLite.Interop.dll" Guid="63874a2a-330d-42a0-bec1-09056dec2beb">
<File Id="x86_SQLite.Interop.dll" Name="SQLite.Interop.dll" Source="$(var.PosControlApplication_TargetDir)x86\SQLite.Interop.dll" />
</Component>
</ComponentGroup>
</Fragment>
另外,为了测试目的,如果我在我的自定义代码中放入线程睡眠并手动将文件添加到临时文件夹,我的功能确实有用