单个 MSI 安装正确的 32 位或 64 位 c# 应用程序 [英] Single MSI to install correct 32 or 64 bit c# application

查看:31
本文介绍了单个 MSI 安装正确的 32 位或 64 位 c# 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 C# 应用程序,它是为 x86(32 位)和 x64(64 位)平台构建的.我的构建系统目前输出两个 MSI 安装程序,每个平台一个.以防万一,我的 C# 应用程序包含一个 Windows 任务栏工具栏,这意味着已安装的 DLL 必须由 explorer.exe 进程加载.

I have a C# application which is built for both x86 (32 bit) and x64 (64 bit) platforms. My build system currently outputs two MSI installers, one for each platform. In case it makes a difference, my C# application includes a windows taskbar toolbar which means that the installed DLL must be loaded by the explorer.exe process.

是否可以生成单个 MSI 安装程序,根据当前操作系统是否为 64 位操作系统来安装我的应用程序的正确版本?

Is it possible to produce a single MSI installer which will install the correct version of my application depending on whether the current OS is a 64 bit OS?

目前已通过使用 http://dotnetinstaller.codeplex.com/ 生成 EXE 来实现这一点它执行架构检查,然后启动正确的 MSI.但是,我更喜欢纯粹基于 MSI 的方法.

This has currently been achieved by using http://dotnetinstaller.codeplex.com/ to produce an EXE which performs the architecture check and then launches the correct MSI. However, I would prefer a purely MSI based approach.

推荐答案

不,这是不可能的.请参阅 Heath Stewart 的 不同的包需要不同的处理器架构帖子.使用 MSI 处理此问题的唯一方法是按照您所描述的方式使用引导程序.如果您只需要将一个或两个文件或密钥放在 64 位位置,则可以(但不推荐)在自定义操作中执行此操作,但更改目标安装位置并使用内置 MSI 文件支持将不起作用不工作.

No, this is not possible. See Heath Stewart's Different Packages are Required for Different Processor Architectures post. The only way to handle this with MSI is with a bootstrap along the lines of what you describe. If you just needed to put a file or key or two in a 64-bit location, it's possible (but not recommended) to do that in a custom action, but changing the target installation location and using built-in MSI file support won't work.

这篇关于单个 MSI 安装正确的 32 位或 64 位 c# 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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