C# 部署wpf应用程序时包含.exe文件
我正在创建一个WPF应用程序,它也使用Kinect 2。现在是发布我的应用程序的时候了,我想创建一个唯一的安装文件来安装应用程序和Kinect SDK。我有Kinect.exe,我想将其包含在我使用Visual studio中的“发布”选项创建的标准设置中(顺便说一句,我使用的是Visual studio 2017)。 阅读了一些资料后,我发现正确的方法是将Kinect SDK插入到我的应用程序的先决条件中。对吗? 因此,我尝试按照以下指南添加该文件: 我在C:\Program Files(x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages中创建了一个文件夹,我添加了产品xml文件:C# 部署wpf应用程序时包含.exe文件,c#,wpf,deployment,exe,kinect-sdk,C#,Wpf,Deployment,Exe,Kinect Sdk,我正在创建一个WPF应用程序,它也使用Kinect 2。现在是发布我的应用程序的时候了,我想创建一个唯一的安装文件来安装应用程序和Kinect SDK。我有Kinect.exe,我想将其包含在我使用Visual studio中的“发布”选项创建的标准设置中(顺便说一句,我使用的是Visual studio 2017)。 阅读了一些资料后,我发现正确的方法是将Kinect SDK插入到我的应用程序的先决条件中。对吗? 因此,我尝试按照以下指南添加该文件: 我在C:\Program Files(
<?xml version="1.0" encoding="utf-8" ?>
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Custom.Bootstrapper.Package">
<PackageFiles>
<PackageFile Name="KinectRuntime-v2.0_1409-Setup.exe"/>
</PackageFiles>
<Commands>
<Command PackageFile="KinectRuntime-v2.0_1409-Setup.exe" Arguments="">
<InstallConditions>
<BypassIf Property="IsMsiInstalled"
Compare="ValueGreaterThan" Value="0"/>
<FailIf Property="AdminUser"
Compare="ValueNotEqualTo" Value="True"
String="NotAnAdmin"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" String="GeneralFailure"/>
</ExitCodes>
</Command>
<Package xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture"
LicenseAgreement="SDKEula.rtf">
<PackageFiles>
<PackageFile Name="SDKEula.rtf"/>
</PackageFiles>
<!-- Defines a localizable string table for error messages. -->
<Strings>
<String Name="DisplayName">Update Consent Dialog</String>
<String Name="Culture">en</String>
<String Name="AU_Unaccepted">The automatic update agreement is not accepted.
</String>
<String Name="GeneralFailure">A failure occurred attempting to launch the setup.</String>
</Strings>
</Package>`
然后在名为“en”的子文件夹中,我添加了包xml文件:
<?xml version="1.0" encoding="utf-8" ?>
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="Custom.Bootstrapper.Package">
<PackageFiles>
<PackageFile Name="KinectRuntime-v2.0_1409-Setup.exe"/>
</PackageFiles>
<Commands>
<Command PackageFile="KinectRuntime-v2.0_1409-Setup.exe" Arguments="">
<InstallConditions>
<BypassIf Property="IsMsiInstalled"
Compare="ValueGreaterThan" Value="0"/>
<FailIf Property="AdminUser"
Compare="ValueNotEqualTo" Value="True"
String="NotAnAdmin"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" String="GeneralFailure"/>
</ExitCodes>
</Command>
<Package xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName"
Culture="Culture"
LicenseAgreement="SDKEula.rtf">
<PackageFiles>
<PackageFile Name="SDKEula.rtf"/>
</PackageFiles>
<!-- Defines a localizable string table for error messages. -->
<Strings>
<String Name="DisplayName">Update Consent Dialog</String>
<String Name="Culture">en</String>
<String Name="AU_Unaccepted">The automatic update agreement is not accepted.
</String>
<String Name="GeneralFailure">A failure occurred attempting to launch the setup.</String>
</Strings>
</Package>`
更新同意对话框
EN
不接受自动更新协议。
尝试启动安装程序时出错。
`
我还添加了rtf文件。所以对我来说应该差不多可以了。但是当我回到VS时,我在先决条件列表中没有看到这个新包。
你能帮我添加Kinect SDK安装程序吗?
非常感谢你,
亚历克斯解决了。我认为该文件夹是正确的,但在查看key GenericBootstrapper时,我发现包的路径是C:\Program Files(x86)\Microsoft SDK\ClickOnce Bootstrapper。在文件夹中添加带有产品和软件包xml的新软件包时,我可以在必备文档中看到Kinect安装程序。发布应用程序一切正常已解决。我认为该文件夹是正确的,但在查看key GenericBootstrapper时,我发现包的路径是C:\Program Files(x86)\Microsoft SDK\ClickOnce Bootstrapper\。在文件夹中添加带有产品和软件包xml的新软件包时,我可以在必备文档中看到Kinect安装程序。发布应用程序一切正常