WiX 在复制所有文件之前启动服务
WiX starting service before all files are copied
我有一个合并模块,它定义了所有 components/resources,并安装并启动了一项服务。
这会构建一个在全新安装期间运行的安装程序。从以前的版本升级时,它会尝试在复制所有文件之前启动服务(服务取决于这些文件)。复制文件后如何让WiX启动服务?
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ComponentRules="OneToOne"?>
<!-- SourceDir instructs IsWiX the location of the directory that contains files for this merge module -->
<?define SourceDir="..\Deploy"?>
<Module Id="AgentMM" Language="1033" Version="1.2.1">
<Package Id="*" Manufacturer="Example Inc" InstallerVersion="500" InstallPrivileges="elevated" InstallScope="perMachine" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="owdF4A3A065B05943EB31D4A22FB4A609B2" Name=" ">
<Directory Id="owd054D805088608C669D54B91D1372FB13" Name="agent">
<Component Id="owc054D805088608C669D54B91D1372FB13" Guid="*">
<CreateFolder />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="MergeRedirectFolder">
<Component Id="owcE4483ACA0E06F6931349C52F4DE32B04" Guid="*">
<File Id="owfE4483ACA0E06F6931349C52F4DE32B04" Source="$(var.SourceDir)\Agent.exe" KeyPath="yes" />
<ServiceInstall Id="si1F414070C0DF7193A1D990B85A956139" Name="Agent" DisplayName="Agent" Description="Reports on system health" ErrorControl="normal" Start="auto" Type="ownProcess" Interactive="no" />
<ServiceControl Id="sc1F414070C0DF7193A1D990B85A956139" Name="Agent" Start="install" Stop="both" Remove="both" Wait="yes" />
</Component>
<Component Id="owcB927FFAE9DA1BF9B833D1BB6615B7D1F" Guid="*">
<File Id="owfB927FFAE9DA1BF9B833D1BB6615B7D1F" Source="$(var.SourceDir)\Cassia.dll" KeyPath="yes" />
</Component>
<Component Id="owc4068B8346D37AA0AFB49DF9E39B8C148" Guid="*">
<File Id="owf4068B8346D37AA0AFB49DF9E39B8C148" Source="$(var.SourceDir)\Cassia.xml" KeyPath="yes" />
</Component>
<Component Id="owc52F75CE3A69F808CE9B7861F5FF157E7" Guid="*">
<File Id="owf52F75CE3A69F808CE9B7861F5FF157E7" Source="$(var.SourceDir)\Agent.exe.config" KeyPath="yes" />
</Component>
<Component Id="owc983DF61596DB6BCFA851E8953561E349" Guid="*">
<File Id="owf983DF61596DB6BCFA851E8953561E349" Source="$(var.SourceDir)\Agent.pdb" KeyPath="yes" />
</Component>
<Component Id="owc2BF30E4776996DDD68B184F69F7D1E00" Guid="*">
<File Id="owf2BF30E4776996DDD68B184F69F7D1E00" Source="$(var.SourceDir)\Utilities.dll" KeyPath="yes" />
</Component>
<Component Id="owcE10E1E5CADEF47AEB294ED17810D9F5D" Guid="*">
<File Id="owfE10E1E5CADEF47AEB294ED17810D9F5D" Source="$(var.SourceDir)\Utilities.pdb" KeyPath="yes" />
</Component>
<Component Id="owcADE9A457248959D397C6B092C7CCF78B" Guid="*">
<File Id="owfADE9A457248959D397C6B092C7CCF78B" Source="$(var.SourceDir)\Microsoft.Win32.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc3FC8434C1A84605AEEBC6A100CA2F3E1" Guid="*">
<File Id="owf3FC8434C1A84605AEEBC6A100CA2F3E1" Source="$(var.SourceDir)\Newtonsoft.Json.dll" KeyPath="yes" />
</Component>
<Component Id="owcDE8FDCCF922CA433A075036DF5C1BE38" Guid="*">
<File Id="owfDE8FDCCF922CA433A075036DF5C1BE38" Source="$(var.SourceDir)\Newtonsoft.Json.xml" KeyPath="yes" />
</Component>
<Component Id="owcBC6AFA6932E46F7635B750194F2DFE30" Guid="*">
<File Id="owfBC6AFA6932E46F7635B750194F2DFE30" Source="$(var.SourceDir)\Nito.AsyncEx.Context.dll" KeyPath="yes" />
</Component>
<Component Id="owcB0247DD3838FC1DDFA9BBA29DDE5A2DB" Guid="*">
<File Id="owfB0247DD3838FC1DDFA9BBA29DDE5A2DB" Source="$(var.SourceDir)\Nito.AsyncEx.Context.xml" KeyPath="yes" />
</Component>
<Component Id="owc80E1432E52AF192AE3A458644EFA81C1" Guid="*">
<File Id="owf80E1432E52AF192AE3A458644EFA81C1" Source="$(var.SourceDir)\Nito.AsyncEx.Tasks.dll" KeyPath="yes" />
</Component>
<Component Id="owc956AF9D61B4B96E805D3B6990EC17870" Guid="*">
<File Id="owf956AF9D61B4B96E805D3B6990EC17870" Source="$(var.SourceDir)\Nito.AsyncEx.Tasks.xml" KeyPath="yes" />
</Component>
<Component Id="owc9797AB99B9AB073F5FAFAE13A51ECE35" Guid="*">
<File Id="owf9797AB99B9AB073F5FAFAE13A51ECE35" Source="$(var.SourceDir)\Nito.Disposables.dll" KeyPath="yes" />
</Component>
<Component Id="owc33EA8A2869C77F471EBAD2451B964902" Guid="*">
<File Id="owf33EA8A2869C77F471EBAD2451B964902" Source="$(var.SourceDir)\Nito.Disposables.xml" KeyPath="yes" />
</Component>
<Component Id="owc25FBE4153F32A5634B0ADA8A6954CC89" Guid="*">
<File Id="owf25FBE4153F32A5634B0ADA8A6954CC89" Source="$(var.SourceDir)\System.AppContext.dll" KeyPath="yes" />
</Component>
<Component Id="owc2F5D24BF1EA2D036DA793146E86BDF87" Guid="*">
<File Id="owf2F5D24BF1EA2D036DA793146E86BDF87" Source="$(var.SourceDir)\System.Collections.Immutable.dll" KeyPath="yes" />
</Component>
<Component Id="owc2BE2107F9B51B79FDB1B19EA807C9C44" Guid="*">
<File Id="owf2BE2107F9B51B79FDB1B19EA807C9C44" Source="$(var.SourceDir)\System.Collections.Immutable.xml" KeyPath="yes" />
</Component>
<Component Id="owcA90D9D10E6DAB6E67011458672887086" Guid="*">
<File Id="owfA90D9D10E6DAB6E67011458672887086" Source="$(var.SourceDir)\System.Console.dll" KeyPath="yes" />
</Component>
<Component Id="owcBC11F886BA2AB9469783C04435BCA0B9" Guid="*">
<File Id="owfBC11F886BA2AB9469783C04435BCA0B9" Source="$(var.SourceDir)\System.Diagnostics.DiagnosticSource.dll" KeyPath="yes" />
</Component>
<Component Id="owc918BEF5091074ABD7E2C05293EDBFE17" Guid="*">
<File Id="owf918BEF5091074ABD7E2C05293EDBFE17" Source="$(var.SourceDir)\System.Diagnostics.DiagnosticSource.xml" KeyPath="yes" />
</Component>
<Component Id="owc38B2B9FCCE93A2C7D2E931C05D695098" Guid="*">
<File Id="owf38B2B9FCCE93A2C7D2E931C05D695098" Source="$(var.SourceDir)\System.Diagnostics.Tracing.dll" KeyPath="yes" />
</Component>
<Component Id="owcB1B1D5CD5E0525947D05C2530DDA9E96" Guid="*">
<File Id="owfB1B1D5CD5E0525947D05C2530DDA9E96" Source="$(var.SourceDir)\System.Globalization.Calendars.dll" KeyPath="yes" />
</Component>
<Component Id="owc5AC6699E38D4EE124CC260C1E19F025A" Guid="">
<File Id="owf5AC6699E38D4EE124CC260C1E19F025A" Source="$(var.SourceDir)\System.IO.Compression.dll" KeyPath="yes" />
</Component>
<Component Id="owc87D8454A10E8D4063130BA0D60AAE450" Guid="*">
<File Id="owf87D8454A10E8D4063130BA0D60AAE450" Source="$(var.SourceDir)\System.IO.Compression.ZipFile.dll" KeyPath="yes" />
</Component>
<Component Id="owc7600C49A56A3819C607969AD7D76A1D1" Guid="*">
<File Id="owf7600C49A56A3819C607969AD7D76A1D1" Source="$(var.SourceDir)\System.IO.dll" KeyPath="yes" />
</Component>
<Component Id="owc6A348A5B38822B45BE742FD5B11ACF09" Guid="*">
<File Id="owf6A348A5B38822B45BE742FD5B11ACF09" Source="$(var.SourceDir)\System.IO.FileSystem.dll" KeyPath="yes" />
</Component>
<Component Id="owc6AF351692769A11F3108B81F1F6AC695" Guid="*">
<File Id="owf6AF351692769A11F3108B81F1F6AC695" Source="$(var.SourceDir)\System.IO.FileSystem.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc14A5BB088914D21BDD2FBEE1395FD78B" Guid="*">
<File Id="owf14A5BB088914D21BDD2FBEE1395FD78B" Source="$(var.SourceDir)\System.Linq.dll" KeyPath="yes" />
</Component>
<Component Id="owc06E33481927840239152432A87297CC9" Guid="*">
<File Id="owf06E33481927840239152432A87297CC9" Source="$(var.SourceDir)\System.Linq.Expressions.dll" KeyPath="yes" />
</Component>
<Component Id="owcB279CD308898A9D5EFCE20D942FB230A" Guid="*">
<File Id="owfB279CD308898A9D5EFCE20D942FB230A" Source="$(var.SourceDir)\System.Net.Http.dll" KeyPath="yes" />
</Component>
<Component Id="owcE7C4094F57B0A8D61E66E0978388F384" Guid="*">
<File Id="owfE7C4094F57B0A8D61E66E0978388F384" Source="$(var.SourceDir)\System.Net.Http.Formatting.dll" KeyPath="yes" />
</Component>
<Component Id="owcAB556DAB8513CFEB9A95F8187FBB7D96" Guid="*">
<File Id="owfAB556DAB8513CFEB9A95F8187FBB7D96" Source="$(var.SourceDir)\System.Net.Http.Formatting.xml" KeyPath="yes" />
</Component>
<Component Id="owcC356900D1A9E2893A31E87C428F0E41B" Guid="*">
<File Id="owfC356900D1A9E2893A31E87C428F0E41B" Source="$(var.SourceDir)\System.Net.Sockets.dll" KeyPath="yes" />
</Component>
<Component Id="owc7A6EE41CC1504CC124313BD05EDA4F44" Guid="*">
<File Id="owf7A6EE41CC1504CC124313BD05EDA4F44" Source="$(var.SourceDir)\System.Reflection.dll" KeyPath="yes" />
</Component>
<Component Id="owcCD2580ECA1FA1A3513916545D2F2BFA5" Guid="*">
<File Id="owfCD2580ECA1FA1A3513916545D2F2BFA5" Source="$(var.SourceDir)\System.Runtime.dll" KeyPath="yes" />
</Component>
<Component Id="owcB0183318DD63CCAB717750C767DC21D7" Guid="*">
<File Id="owfB0183318DD63CCAB717750C767DC21D7" Source="$(var.SourceDir)\System.Runtime.Extensions.dll" KeyPath="yes" />
</Component>
<Component Id="owc456C772F6BA4F8274FFF4540362C5A62" Guid="*">
<File Id="owf456C772F6BA4F8274FFF4540362C5A62" Source="$(var.SourceDir)\System.Runtime.InteropServices.dll" KeyPath="yes" />
</Component>
<Component Id="owc142B759C8549F55E22EAD18CF214B77E" Guid="*">
<File Id="owf142B759C8549F55E22EAD18CF214B77E" Source="$(var.SourceDir)\System.Runtime.InteropServices.RuntimeInformation.dll" KeyPath="yes" />
</Component>
<Component Id="owcD6CB46E32249D9DFE253203C9E68622F" Guid="*">
<File Id="owfD6CB46E32249D9DFE253203C9E68622F" Source="$(var.SourceDir)\System.Security.Cryptography.Algorithms.dll" KeyPath="yes" />
</Component>
<Component Id="owcF620F5D5E0DED6F51741DE9E09BAA10C" Guid="*">
<File Id="owfF620F5D5E0DED6F51741DE9E09BAA10C" Source="$(var.SourceDir)\System.Security.Cryptography.Encoding.dll" KeyPath="yes" />
</Component>
<Component Id="owc0F0B6DF93E003C893A5E5E253BAF6C85" Guid="*">
<File Id="owf0F0B6DF93E003C893A5E5E253BAF6C85" Source="$(var.SourceDir)\System.Security.Cryptography.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc328828932DA40CAED6EC4EA121F7534D" Guid="*">
<File Id="owf328828932DA40CAED6EC4EA121F7534D" Source="$(var.SourceDir)\System.Security.Cryptography.X509Certificates.dll" KeyPath="yes" />
</Component>
<Component Id="owc50D709F95681A7937E1395ED21E4DE32" Guid="*">
<File Id="owf50D709F95681A7937E1395ED21E4DE32" Source="$(var.SourceDir)\System.Text.RegularExpressions.dll" KeyPath="yes" />
</Component>
<Component Id="owc1EC9EF9564C76F0DA10AA382F306146E" Guid="*">
<File Id="owf1EC9EF9564C76F0DA10AA382F306146E" Source="$(var.SourceDir)\System.Xml.ReaderWriter.dll" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<ComponentGroupRef Id="Custom" />
</Module>
</Wix>
我正在即兴发挥 - 我目前还没有准备好对此进行正确测试,但这里是:
一些问题
- 您的日志文件中有许多错误。该日志文件末尾的实际安装状态是什么?对于同一个应用程序/MSI 安装,您是否在 add/remove 程序中有两个条目?在日志文件中,它看起来像是一次失败的重大升级,但有点难以分辨。看起来至少有一个安装回滚了,也许两个都回滚了。您机器上的最终状态是什么?
- 您的
TARGETDIR
和 ROOTDRIVE
设置为 H:。那是什么?你的 H: 驱动器上有什么?您的 IIS 安装?看起来 C:\ 是您的系统文件夹。
- 为什么将 服务设置为在安装和卸载时都卸载 ?
ServiceControl
和 ServiceInstall
表在您编译的 MSI 文件中是什么样的? (用 Orca 或等价物打开以进行检查 - 如果您报告这些值,那就太好了。特别是 ServiceInstall:ServiceType
和 ServiceControl:Event
)。我安装服务已经有一段时间了,但我记得只有几个选项真正有意义。我想我总是使用:在安装时创建,在安装时停止并开始,在卸载时停止并删除。换句话说:尝试在安装时不删除 。
- 以下文件永远不会安装:Nito.AsyncEx.Tasks.xml 和 Nito.AsyncEx.Context.dll 由于此日志消息:
MSI (s) (BC:D4) [11:46:53:020]: Disallowing installation of component: {6EA4EDA3-FBF8-8B13-1DAA-342C5D7EDCB5} since the same component with higher versioned keyfile exists
MSI (s) (BC:D4) [11:46:53:022]: Disallowing installation of component: {7B9CD5B0-C538-77AE-E4D9-87B4A74C6207} since the same component with higher versioned keyfile exists
- 您应该修复 dll 的版本号,以便升级后的 MSI 安装正确的版本。 这些丢失的文件版本会阻止您的服务启动吗?
日志文件检查
除了帮助您在实验时正确阅读日志文件外,我不确定要推荐什么。我确实浏览了您的日志,其中有几个奇怪的地方 - 几个失败的操作。每当你创建一个日志文件时,你应该总是 first search for "value 3" as explained by Rob Mensching (WiX creator).
所以搜索"value 3"。研究错误,然后检查这些 link 以解释返回的错误:
- Logging of Action Return Values
- Troubleshooting installation errors using MSI logs
- MsiExec.exe and InstMsi.exe Error Messages
- Windows Installer Error Messages
- How to Interpret Windows Installer Logs
Annotated_Windows_Installer_Log.pdf
文件很有帮助。
- 它的下载似乎已损坏 link。你要的话我有文件
我想这不是真正的答案,但有些 link 可以帮助您继续前进。试一试,让我们知道发生了什么,如果有更多信息,我们可以 "evolve" 给出答案。
为什么说服务启动了"before all the files have been installed"?不清楚您是否在猜测,或者还有一些您没有 post 的额外信息。问题看起来肯定是服务启动失败,但是,为什么又说是因为文件丢失了呢?
我会再次指出,您提供的日志不是您 posted 的源 WiX 的日志,因为该源没有主要升级功能,posted 源也有名为 "Agent" 的服务不是日志中的服务名称。由于我们在这里讨论的是服务,因此当源 WiX 或服务名称与日志都不匹配时,它就没有用了。
话虽如此,并假设缺少文件,最可能的问题是您 运行 进入了 Windows 安装程序错误,它决定不卸载文件,然后发现这是升级,但还是将其删除。 post 描述了问题,您可以尝试在 CostInitialize 之前对 RemoveExistingProducts 进行排序,看看是否可以解决问题
您还应检查您是否遇到过此处报告的类似问题:
您在升级期间降级文件版本的位置。
我有一个合并模块,它定义了所有 components/resources,并安装并启动了一项服务。
这会构建一个在全新安装期间运行的安装程序。从以前的版本升级时,它会尝试在复制所有文件之前启动服务(服务取决于这些文件)。复制文件后如何让WiX启动服务?
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ComponentRules="OneToOne"?>
<!-- SourceDir instructs IsWiX the location of the directory that contains files for this merge module -->
<?define SourceDir="..\Deploy"?>
<Module Id="AgentMM" Language="1033" Version="1.2.1">
<Package Id="*" Manufacturer="Example Inc" InstallerVersion="500" InstallPrivileges="elevated" InstallScope="perMachine" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="owdF4A3A065B05943EB31D4A22FB4A609B2" Name=" ">
<Directory Id="owd054D805088608C669D54B91D1372FB13" Name="agent">
<Component Id="owc054D805088608C669D54B91D1372FB13" Guid="*">
<CreateFolder />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="MergeRedirectFolder">
<Component Id="owcE4483ACA0E06F6931349C52F4DE32B04" Guid="*">
<File Id="owfE4483ACA0E06F6931349C52F4DE32B04" Source="$(var.SourceDir)\Agent.exe" KeyPath="yes" />
<ServiceInstall Id="si1F414070C0DF7193A1D990B85A956139" Name="Agent" DisplayName="Agent" Description="Reports on system health" ErrorControl="normal" Start="auto" Type="ownProcess" Interactive="no" />
<ServiceControl Id="sc1F414070C0DF7193A1D990B85A956139" Name="Agent" Start="install" Stop="both" Remove="both" Wait="yes" />
</Component>
<Component Id="owcB927FFAE9DA1BF9B833D1BB6615B7D1F" Guid="*">
<File Id="owfB927FFAE9DA1BF9B833D1BB6615B7D1F" Source="$(var.SourceDir)\Cassia.dll" KeyPath="yes" />
</Component>
<Component Id="owc4068B8346D37AA0AFB49DF9E39B8C148" Guid="*">
<File Id="owf4068B8346D37AA0AFB49DF9E39B8C148" Source="$(var.SourceDir)\Cassia.xml" KeyPath="yes" />
</Component>
<Component Id="owc52F75CE3A69F808CE9B7861F5FF157E7" Guid="*">
<File Id="owf52F75CE3A69F808CE9B7861F5FF157E7" Source="$(var.SourceDir)\Agent.exe.config" KeyPath="yes" />
</Component>
<Component Id="owc983DF61596DB6BCFA851E8953561E349" Guid="*">
<File Id="owf983DF61596DB6BCFA851E8953561E349" Source="$(var.SourceDir)\Agent.pdb" KeyPath="yes" />
</Component>
<Component Id="owc2BF30E4776996DDD68B184F69F7D1E00" Guid="*">
<File Id="owf2BF30E4776996DDD68B184F69F7D1E00" Source="$(var.SourceDir)\Utilities.dll" KeyPath="yes" />
</Component>
<Component Id="owcE10E1E5CADEF47AEB294ED17810D9F5D" Guid="*">
<File Id="owfE10E1E5CADEF47AEB294ED17810D9F5D" Source="$(var.SourceDir)\Utilities.pdb" KeyPath="yes" />
</Component>
<Component Id="owcADE9A457248959D397C6B092C7CCF78B" Guid="*">
<File Id="owfADE9A457248959D397C6B092C7CCF78B" Source="$(var.SourceDir)\Microsoft.Win32.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc3FC8434C1A84605AEEBC6A100CA2F3E1" Guid="*">
<File Id="owf3FC8434C1A84605AEEBC6A100CA2F3E1" Source="$(var.SourceDir)\Newtonsoft.Json.dll" KeyPath="yes" />
</Component>
<Component Id="owcDE8FDCCF922CA433A075036DF5C1BE38" Guid="*">
<File Id="owfDE8FDCCF922CA433A075036DF5C1BE38" Source="$(var.SourceDir)\Newtonsoft.Json.xml" KeyPath="yes" />
</Component>
<Component Id="owcBC6AFA6932E46F7635B750194F2DFE30" Guid="*">
<File Id="owfBC6AFA6932E46F7635B750194F2DFE30" Source="$(var.SourceDir)\Nito.AsyncEx.Context.dll" KeyPath="yes" />
</Component>
<Component Id="owcB0247DD3838FC1DDFA9BBA29DDE5A2DB" Guid="*">
<File Id="owfB0247DD3838FC1DDFA9BBA29DDE5A2DB" Source="$(var.SourceDir)\Nito.AsyncEx.Context.xml" KeyPath="yes" />
</Component>
<Component Id="owc80E1432E52AF192AE3A458644EFA81C1" Guid="*">
<File Id="owf80E1432E52AF192AE3A458644EFA81C1" Source="$(var.SourceDir)\Nito.AsyncEx.Tasks.dll" KeyPath="yes" />
</Component>
<Component Id="owc956AF9D61B4B96E805D3B6990EC17870" Guid="*">
<File Id="owf956AF9D61B4B96E805D3B6990EC17870" Source="$(var.SourceDir)\Nito.AsyncEx.Tasks.xml" KeyPath="yes" />
</Component>
<Component Id="owc9797AB99B9AB073F5FAFAE13A51ECE35" Guid="*">
<File Id="owf9797AB99B9AB073F5FAFAE13A51ECE35" Source="$(var.SourceDir)\Nito.Disposables.dll" KeyPath="yes" />
</Component>
<Component Id="owc33EA8A2869C77F471EBAD2451B964902" Guid="*">
<File Id="owf33EA8A2869C77F471EBAD2451B964902" Source="$(var.SourceDir)\Nito.Disposables.xml" KeyPath="yes" />
</Component>
<Component Id="owc25FBE4153F32A5634B0ADA8A6954CC89" Guid="*">
<File Id="owf25FBE4153F32A5634B0ADA8A6954CC89" Source="$(var.SourceDir)\System.AppContext.dll" KeyPath="yes" />
</Component>
<Component Id="owc2F5D24BF1EA2D036DA793146E86BDF87" Guid="*">
<File Id="owf2F5D24BF1EA2D036DA793146E86BDF87" Source="$(var.SourceDir)\System.Collections.Immutable.dll" KeyPath="yes" />
</Component>
<Component Id="owc2BE2107F9B51B79FDB1B19EA807C9C44" Guid="*">
<File Id="owf2BE2107F9B51B79FDB1B19EA807C9C44" Source="$(var.SourceDir)\System.Collections.Immutable.xml" KeyPath="yes" />
</Component>
<Component Id="owcA90D9D10E6DAB6E67011458672887086" Guid="*">
<File Id="owfA90D9D10E6DAB6E67011458672887086" Source="$(var.SourceDir)\System.Console.dll" KeyPath="yes" />
</Component>
<Component Id="owcBC11F886BA2AB9469783C04435BCA0B9" Guid="*">
<File Id="owfBC11F886BA2AB9469783C04435BCA0B9" Source="$(var.SourceDir)\System.Diagnostics.DiagnosticSource.dll" KeyPath="yes" />
</Component>
<Component Id="owc918BEF5091074ABD7E2C05293EDBFE17" Guid="*">
<File Id="owf918BEF5091074ABD7E2C05293EDBFE17" Source="$(var.SourceDir)\System.Diagnostics.DiagnosticSource.xml" KeyPath="yes" />
</Component>
<Component Id="owc38B2B9FCCE93A2C7D2E931C05D695098" Guid="*">
<File Id="owf38B2B9FCCE93A2C7D2E931C05D695098" Source="$(var.SourceDir)\System.Diagnostics.Tracing.dll" KeyPath="yes" />
</Component>
<Component Id="owcB1B1D5CD5E0525947D05C2530DDA9E96" Guid="*">
<File Id="owfB1B1D5CD5E0525947D05C2530DDA9E96" Source="$(var.SourceDir)\System.Globalization.Calendars.dll" KeyPath="yes" />
</Component>
<Component Id="owc5AC6699E38D4EE124CC260C1E19F025A" Guid="">
<File Id="owf5AC6699E38D4EE124CC260C1E19F025A" Source="$(var.SourceDir)\System.IO.Compression.dll" KeyPath="yes" />
</Component>
<Component Id="owc87D8454A10E8D4063130BA0D60AAE450" Guid="*">
<File Id="owf87D8454A10E8D4063130BA0D60AAE450" Source="$(var.SourceDir)\System.IO.Compression.ZipFile.dll" KeyPath="yes" />
</Component>
<Component Id="owc7600C49A56A3819C607969AD7D76A1D1" Guid="*">
<File Id="owf7600C49A56A3819C607969AD7D76A1D1" Source="$(var.SourceDir)\System.IO.dll" KeyPath="yes" />
</Component>
<Component Id="owc6A348A5B38822B45BE742FD5B11ACF09" Guid="*">
<File Id="owf6A348A5B38822B45BE742FD5B11ACF09" Source="$(var.SourceDir)\System.IO.FileSystem.dll" KeyPath="yes" />
</Component>
<Component Id="owc6AF351692769A11F3108B81F1F6AC695" Guid="*">
<File Id="owf6AF351692769A11F3108B81F1F6AC695" Source="$(var.SourceDir)\System.IO.FileSystem.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc14A5BB088914D21BDD2FBEE1395FD78B" Guid="*">
<File Id="owf14A5BB088914D21BDD2FBEE1395FD78B" Source="$(var.SourceDir)\System.Linq.dll" KeyPath="yes" />
</Component>
<Component Id="owc06E33481927840239152432A87297CC9" Guid="*">
<File Id="owf06E33481927840239152432A87297CC9" Source="$(var.SourceDir)\System.Linq.Expressions.dll" KeyPath="yes" />
</Component>
<Component Id="owcB279CD308898A9D5EFCE20D942FB230A" Guid="*">
<File Id="owfB279CD308898A9D5EFCE20D942FB230A" Source="$(var.SourceDir)\System.Net.Http.dll" KeyPath="yes" />
</Component>
<Component Id="owcE7C4094F57B0A8D61E66E0978388F384" Guid="*">
<File Id="owfE7C4094F57B0A8D61E66E0978388F384" Source="$(var.SourceDir)\System.Net.Http.Formatting.dll" KeyPath="yes" />
</Component>
<Component Id="owcAB556DAB8513CFEB9A95F8187FBB7D96" Guid="*">
<File Id="owfAB556DAB8513CFEB9A95F8187FBB7D96" Source="$(var.SourceDir)\System.Net.Http.Formatting.xml" KeyPath="yes" />
</Component>
<Component Id="owcC356900D1A9E2893A31E87C428F0E41B" Guid="*">
<File Id="owfC356900D1A9E2893A31E87C428F0E41B" Source="$(var.SourceDir)\System.Net.Sockets.dll" KeyPath="yes" />
</Component>
<Component Id="owc7A6EE41CC1504CC124313BD05EDA4F44" Guid="*">
<File Id="owf7A6EE41CC1504CC124313BD05EDA4F44" Source="$(var.SourceDir)\System.Reflection.dll" KeyPath="yes" />
</Component>
<Component Id="owcCD2580ECA1FA1A3513916545D2F2BFA5" Guid="*">
<File Id="owfCD2580ECA1FA1A3513916545D2F2BFA5" Source="$(var.SourceDir)\System.Runtime.dll" KeyPath="yes" />
</Component>
<Component Id="owcB0183318DD63CCAB717750C767DC21D7" Guid="*">
<File Id="owfB0183318DD63CCAB717750C767DC21D7" Source="$(var.SourceDir)\System.Runtime.Extensions.dll" KeyPath="yes" />
</Component>
<Component Id="owc456C772F6BA4F8274FFF4540362C5A62" Guid="*">
<File Id="owf456C772F6BA4F8274FFF4540362C5A62" Source="$(var.SourceDir)\System.Runtime.InteropServices.dll" KeyPath="yes" />
</Component>
<Component Id="owc142B759C8549F55E22EAD18CF214B77E" Guid="*">
<File Id="owf142B759C8549F55E22EAD18CF214B77E" Source="$(var.SourceDir)\System.Runtime.InteropServices.RuntimeInformation.dll" KeyPath="yes" />
</Component>
<Component Id="owcD6CB46E32249D9DFE253203C9E68622F" Guid="*">
<File Id="owfD6CB46E32249D9DFE253203C9E68622F" Source="$(var.SourceDir)\System.Security.Cryptography.Algorithms.dll" KeyPath="yes" />
</Component>
<Component Id="owcF620F5D5E0DED6F51741DE9E09BAA10C" Guid="*">
<File Id="owfF620F5D5E0DED6F51741DE9E09BAA10C" Source="$(var.SourceDir)\System.Security.Cryptography.Encoding.dll" KeyPath="yes" />
</Component>
<Component Id="owc0F0B6DF93E003C893A5E5E253BAF6C85" Guid="*">
<File Id="owf0F0B6DF93E003C893A5E5E253BAF6C85" Source="$(var.SourceDir)\System.Security.Cryptography.Primitives.dll" KeyPath="yes" />
</Component>
<Component Id="owc328828932DA40CAED6EC4EA121F7534D" Guid="*">
<File Id="owf328828932DA40CAED6EC4EA121F7534D" Source="$(var.SourceDir)\System.Security.Cryptography.X509Certificates.dll" KeyPath="yes" />
</Component>
<Component Id="owc50D709F95681A7937E1395ED21E4DE32" Guid="*">
<File Id="owf50D709F95681A7937E1395ED21E4DE32" Source="$(var.SourceDir)\System.Text.RegularExpressions.dll" KeyPath="yes" />
</Component>
<Component Id="owc1EC9EF9564C76F0DA10AA382F306146E" Guid="*">
<File Id="owf1EC9EF9564C76F0DA10AA382F306146E" Source="$(var.SourceDir)\System.Xml.ReaderWriter.dll" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<ComponentGroupRef Id="Custom" />
</Module>
</Wix>
我正在即兴发挥 - 我目前还没有准备好对此进行正确测试,但这里是:
一些问题
- 您的日志文件中有许多错误。该日志文件末尾的实际安装状态是什么?对于同一个应用程序/MSI 安装,您是否在 add/remove 程序中有两个条目?在日志文件中,它看起来像是一次失败的重大升级,但有点难以分辨。看起来至少有一个安装回滚了,也许两个都回滚了。您机器上的最终状态是什么?
- 您的
TARGETDIR
和ROOTDRIVE
设置为 H:。那是什么?你的 H: 驱动器上有什么?您的 IIS 安装?看起来 C:\ 是您的系统文件夹。 - 为什么将 服务设置为在安装和卸载时都卸载 ?
ServiceControl
和ServiceInstall
表在您编译的 MSI 文件中是什么样的? (用 Orca 或等价物打开以进行检查 - 如果您报告这些值,那就太好了。特别是ServiceInstall:ServiceType
和ServiceControl:Event
)。我安装服务已经有一段时间了,但我记得只有几个选项真正有意义。我想我总是使用:在安装时创建,在安装时停止并开始,在卸载时停止并删除。换句话说:尝试在安装时不删除 。 - 以下文件永远不会安装:Nito.AsyncEx.Tasks.xml 和 Nito.AsyncEx.Context.dll 由于此日志消息:
MSI (s) (BC:D4) [11:46:53:020]: Disallowing installation of component: {6EA4EDA3-FBF8-8B13-1DAA-342C5D7EDCB5} since the same component with higher versioned keyfile exists
MSI (s) (BC:D4) [11:46:53:022]: Disallowing installation of component: {7B9CD5B0-C538-77AE-E4D9-87B4A74C6207} since the same component with higher versioned keyfile exists
- 您应该修复 dll 的版本号,以便升级后的 MSI 安装正确的版本。 这些丢失的文件版本会阻止您的服务启动吗?
日志文件检查
除了帮助您在实验时正确阅读日志文件外,我不确定要推荐什么。我确实浏览了您的日志,其中有几个奇怪的地方 - 几个失败的操作。每当你创建一个日志文件时,你应该总是 first search for "value 3" as explained by Rob Mensching (WiX creator).
所以搜索"value 3"。研究错误,然后检查这些 link 以解释返回的错误:
- Logging of Action Return Values
- Troubleshooting installation errors using MSI logs
- MsiExec.exe and InstMsi.exe Error Messages
- Windows Installer Error Messages
- How to Interpret Windows Installer Logs
Annotated_Windows_Installer_Log.pdf
文件很有帮助。- 它的下载似乎已损坏 link。你要的话我有文件
我想这不是真正的答案,但有些 link 可以帮助您继续前进。试一试,让我们知道发生了什么,如果有更多信息,我们可以 "evolve" 给出答案。
为什么说服务启动了"before all the files have been installed"?不清楚您是否在猜测,或者还有一些您没有 post 的额外信息。问题看起来肯定是服务启动失败,但是,为什么又说是因为文件丢失了呢?
我会再次指出,您提供的日志不是您 posted 的源 WiX 的日志,因为该源没有主要升级功能,posted 源也有名为 "Agent" 的服务不是日志中的服务名称。由于我们在这里讨论的是服务,因此当源 WiX 或服务名称与日志都不匹配时,它就没有用了。
话虽如此,并假设缺少文件,最可能的问题是您 运行 进入了 Windows 安装程序错误,它决定不卸载文件,然后发现这是升级,但还是将其删除。 post 描述了问题,您可以尝试在 CostInitialize 之前对 RemoveExistingProducts 进行排序,看看是否可以解决问题
您还应检查您是否遇到过此处报告的类似问题:
您在升级期间降级文件版本的位置。