WiX Toolset PermissionEx 问题 - 安装后应用程序无法运行

WiX Toolset PermissionEx Problem - App Does Not Run After Installation(WiX Toolset PermissionEx 问题 - 安装后应用程序无法运行)
本文介绍了WiX Toolset PermissionEx 问题 - 安装后应用程序无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Wpf/C# 中有一个应用程序,并使用 WiX 工具集创建了一个安装程序.安装程序适用于所有经过测试的计算机,它不会显示任何错误消息.但是,在某些机器上,应用程序在安装后不会运行,即使使用管理员用户也是如此.我相信这是一些权限问题,但我不确定.如何授予当前用户权限?

I have an application in Wpf/C# and I created an installer with the WiX Toolset. The installer works on all tested computers, it does not display any error messages. However, on some machines, the application does not run after installation, even with an administrator user. I believe it's some permission problem, but I'm not sure. How do I give permissions to the current user?

更新:到目前为止,该问题仅发生在两台装有 Windows 10 Home 的机器上.我想可能是我设置的 InstallerVersion.

UPDATE: So far the problem has only occurred on two machines with Windows 10 Home. I thought it might be the InstallerVersion that I set.

以下是最相关的代码片段.

Below are the most relevant code snippets.

非常欢迎任何帮助.谢谢你.

Any help is very welcome. Thank you.

<Product Id="{2A173950-... }"
       Codepage="UTF-8"
       Name="Xyz"
       Language="1033"
       Version="1.0"
       Manufacturer="Xyz Software"
       UpgradeCode="{8B843496-... }">

<Package InstallerVersion="301"
         Compressed="yes"
         InstallScope="perMachine"
         Manufacturer="Xyz Software"
         Description="Xyz Installer"
         Keywords="Practice,Installer,MSI"
         Comments="(c) 2018, Xyz Software" />

<Feature Id="ProductFeature" Title="Xyz Installer" Level="1">
  <ComponentGroupRef Id="ApplicationComponents" />
  <ComponentGroupRef Id="DataComponents" />
  <ComponentGroupRef Id="SavedFilesEmptyFolder" />
  <ComponentGroupRef Id="StartMenuComponents" />
  <ComponentGroupRef Id="DesktopComponents" />
</Feature>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
  <!--Program Files Folder-->
  <Directory Id="ProgramFilesFolder">
    <Directory Id="CompanyFolder" Name="Xyz Software" >
      <Directory Id="ApplicationFolder" Name="Xyz" >
        <Directory Id="DataFolder" Name="Data" >
          <Directory Id="SavedFilesFolder" Name="Saved Files" />
        </Directory>
      </Directory>
    </Directory>
  </Directory>
  <!--Start Menu-->
  <Directory Id="ProgramMenuFolder">
    <Directory Id="StartMenuFolder" Name="Xyz" />
  </Directory>
  <!--Desktop-->
  <Directory Id="DesktopFolder" Name="Desktop" />
</Directory>

<Fragment>
<ComponentGroup Id="ApplicationComponents" Directory="ApplicationFolder">
  <Component Id="CmpXyzExe" Guid="{1EA7372D-... }">
    <File Id="FilXyzExe" Source="Xyz.exe" KeyPath="yes" />
  </Component>
  <Component Id="CmpSetPermissionsApp" Guid="{36CDCE9A-... }" >
    <CreateFolder>
      <util:PermissionEx User="Administrators" GenericAll="yes" />
      <util:PermissionEx User="Users" GenericAll="yes" />
    </CreateFolder>
  </Component>
</ComponentGroup>

<ComponentGroup Id="DataComponents" Directory="DataFolder">
  <Component Id="CmpXyzDic" Guid="{A32B6F47-... }">
    <File Id="FilXyzDic" Source="Xyz.dic"  />
  </Component>
</ComponentGroup>


<Fragment>
<ComponentGroup Id="StartMenuComponents" Directory="StartMenuFolder">
  <Component Id="CmpStartMenuShortcuts" Guid="{818AD65E-... }">
    <CreateFolder />
    <Shortcut Id="SctApplication"
              Name="Xyz"
              Target="[ApplicationFolder]Xyz.exe" />
    <Shortcut Id="SctUninstall"
              Name="Uninstall Xyz"
              Description="Uninstalls Xyz and all of its components"
              Target="[System64Folder]msiexec.exe"
              Arguments="/x [ProductCode]" />
    <RemoveFolder Id="RmvStartMenuComponents"
                  On="uninstall" />
    <RegistryValue Root="HKCU"
                   Key="SoftwareMicrosoftXyz"
                   Name="installed"
                   Type="integer"
                   Value="1"
                   KeyPath="yes" />
  </Component>
</ComponentGroup>

<Fragment>
<ComponentGroup Id="DesktopComponents" Directory="DesktopFolder">
  <Component Id="CmpDesktopShortcuts" Guid="{4FC34354-... }">
    <Shortcut Id="SctApplicationDesktop"
              Name="Xyz"
              Target="[ApplicationFolder]Xyz.exe" />
    <RemoveFolder Id="RmvDesktopComponents"
                  On="uninstall" />
    <RegistryValue Root="HKCU"
                   Key="SoftwareMicrosoftXyz"
                   Name="installed"
                   Type="integer"
                   Value="1"
                   KeyPath="yes" />
  </Component>
</ComponentGroup>

推荐答案

权限:如上所述,可以快速检查权限是否应用正确,如下所述:检查权限.

运行时依赖/要求:如果这种情况发生在极少数机器上,人们会认为原因是运行时要求,即没见过.你确定你安装了 Visual Studio C++ 运行时在有问题的计算机上?还是其他一些运行时要求?

Runtime Dependency / Requirement: If this happens on very few machines one would think the cause to be a runtime requirement that is not met. Are you sure you have the visual studio C++ runtime installed on the computers in question? Or some other runtime requirement?

调试启动问题:有几个较旧的答案提供有关调试的建议.现在我看到它们是如此相似,以至于我需要停止以不同的方式重复自己:

Debugging Launch Issues: There are several older answers with suggestions on debugging. Now that I look at them they are so similar that I need to stop repeating myself in different flavors:

  • 应用程序启动问题检查清单(想法列表)
  • 启动调试二进制文件并附加调试器和依赖项扫描工具(应将哪些 winform 项目文件打包到安装程序中)
  • WiX 服务的具体表现如何内部安装工作?
  • wix c# 应用安装后无法启动
  • Visual Studio 安装程序在 AspNetDiagnosticPack.msi 上失败
  • 尝试创建uc.micro"时,Windows 中的设置过程失败访问被拒绝文件夹
  • 在用户文件夹中创建一个.config文件夹
  • EXE 文件不工作

过程:简而言之,我会尝试确定是否缺少运行时.您可以使用 procmon.exedependency walker 来检查这一点.您还可以使用上述调试方法构建调试二进制文件并在启动期间连接到二进制文件.前提是二进制文件完全可用.

Procedure: In brief I would try to determine if there is a missing runtime. You can use procmon.exe or dependency walker to check for this. You can also use the debugging approach described above where you build debug binaries and connect to the binaries during launch. Provided the binary gets off the ground at all.

这篇关于WiX Toolset PermissionEx 问题 - 安装后应用程序无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)