通过 SSH 运行时 WIX/MSI CopyFile 不起作用 [英] WIX/MSI CopyFile doesn't work when running through SSH

查看:19
本文介绍了通过 SSH 运行时 WIX/MSI CopyFile 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 WixTool 3.10 构建了一个简单的 MSI 文件.
其中一项功能是复制主机上已存在的文件.
当我通过远程桌面安装此 msi 时,一切正常.
但是,如果我通过 SSH 登录并运行此 MSI,则不会复制该文件.
这是我的 wxs 文件的简化版本:

I have built a simple MSI file with WixTool 3.10.
One of the feature is to copy a file which already exists on host.
Everything is working fine when I install this msi through Remote Desktop.
However if I login through SSH and run this MSI, the file doesn't get copied.
Here's a simplified version of my wxs file:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="my product" Language="1033" Version="1.0" Manufacturer="Allen" 
           UpgradeCode="PUT-GUID-HERE">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MediaTemplate EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="My Folder">
        </Directory>
      </Directory>
    </Directory>

    <Property Id="FILEA">
      <DirectorySearch Id="SearchSourceDir" Path="[SOURCEDIR]">
          <FileSearch Name="fileA.txt" />
      </DirectorySearch>
    </Property>

    <Component Id="cmpCopyFile" Guid="*" Directory="INSTALLFOLDER">
      <CopyFile Id="CopyFileA" SourceProperty="FILEA" DestinationProperty="INSTALLFOLDER"/>
    </Component>

    <Feature Id="FeatureCopyFile" Title="Copy file" Level="1">
      <ComponentRef Id="cmpCopyFile" />
    </Feature>
  </Product>
</Wix>

这是我用于安装的命令:

And here's the command I used for install:

msiexec /i test.msi /l*v install.log

在日志中,我可以看到安装了功能和组件,但是文件没有得到复制.
这是预期的行为吗?感谢您提供任何帮助或建议.

Inside the log I can see the feature and component gets installed, however the file didn't get copy.
Is this the expected behavior? Any help or advice is appreciated.

更新:这里是本地安装和远程安装的日志install_local.loginstall_remote.log

Update: Here are the logs for local install and remote install install_local.log install_remote.log

推荐答案

SecureCustomProperties:远程安装是静默的,而客户端是交互式的?这可能会影响 APPSEARCH 属性在延迟/静默模式下的可用性.

SecureCustomProperties: The remote install is silent and the client one is interactive? This could affect the availability of the APPSEARCH property in deferred / silent mode.

您需要将属性标记为安全,以便让它们从客户端-(GUI)传递到服务器进程(安装).您能否尝试在您的 WiX 源代码中更改此设置并重新编译:

You need to mark properties secured in order to have them pass from client- (GUI) to server process (Install). Could you please try to change this in your WiX source and recompile:

当前:

<Property Id="FILEA">

更新:

<Property Id="FILEA" Secure="yes">

然后重新编译并测试安装.

Then recompile and test install.

或者,您可以修改或修补"当前 MSI 文件中的 SecureCustomProperties 属性以包含 FILEA.这包括在 SecureCustomProperties 的当前值前面加上 FILEA 的前缀,如下所示:

Alternatively you can modify or "hotfix" the SecureCustomProperties property in your current MSI file to include FILEA. That involves prefixing the current value for SecureCustomProperties with FILEA along these lines:

FILEA;NETFRAMEWORK20;WIX_DOWNGRADE_DETECTED;WIX_UPGRADE_DETECTED

如果您从 WiX 源重新编译 MSI,这将为您完成 - 显然.添加此项以防源无法使用指定的 Secured 属性进行编译.

If you recompile the MSI from the WiX source this will be done for you - obviously. Adding this in case the source won't compile with the Secured attribute specified.

除此之外,从本地日志文件来看,这看起来很奇怪:

Apart from that, this looks odd from the local log file:

PROPERTY CHANGE: Adding FILEA property. Its value is 'C:\Users\tetter\fileA.txt\'.

但让我们看看以上是否能解决问题.

But let us see if the above solves the problem.

避免文件复制?:什么 SSH 客户端?从未尝试通过 SSH 部署 MSI.不是 100% 匹配,但 也许阅读我对这个问题的回答配置文件和设置管理.通过更强大的方式安装文件很可能更可靠 - 正如您从当前问题中可以清楚地看到的那样.例如通过使用 IniFile 表或使用 WiX 的 XML 写入功能.

Avoid File Copy?: What SSH client? Never tried to deploy MSI via SSH. Not 100% match, but maybe read my answer on the issue of config files and settings management. It would very likely be more reliable to install the file by more robust means - as you can clearly see from the current problems. For example by using the IniFile table or to use WiX's XML writing capabilities.

应用程序下载:老实说,为什么不直接从您的应用程序从数据库或 UNC 路径下载这些设置?应该为您节省任何部署问题,并且您具有更好的调试能力(在测试计算机上实时调试,没有一次性"部署问题以限制调试能力调查),并且您可以确保所有客户端都拥有最新的提供他们可以访问UNC路径的设置?只是一个想法.

Application Download: To be honest, why not download these settings from a database or from a UNC path directly from your application? Should save you any deployment issues, and you have better debugging abilities (debugging in real-time on test computers, no "one-shot" deployment problems to have limited debugging ability to investigate), and you can ensure that all clients have the latest settings provided they can access the UNC path? Just an idea.

原因:如果我要对原因进行理论分析,我会说您的 MSI 通过远程桌面在您的管理上下文中运行,并且可以访问您的登录上下文和访问令牌并因此拥有该股份的权利.当您从 SSH 启动 MSI 时,它可能会在系统上下文中运行,根本没有网络访问权限 - 或者非常有限.只是猜测.

Cause: If I was to theorize on the cause, I would say your MSI runs in your admin context via Remote Desktop with access to your login context and access token and hence have rights on the share. When you kick off the MSI from SSH it might run in system context, with no network access at all - or very limited. Just a guess.

这篇关于通过 SSH 运行时 WIX/MSI CopyFile 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆