简体   繁体   English

在MSI安装程序中使用C#创建自定义对话框

[英]Creating custom dialog using C# in MSI installer

We(my project team) have an existing MSI installer for a VS 2010 windows application. 我们(我的项目团队)已经为VS 2010 Windows应用程序安装了现有的MSI安装程序。 There is a license file we are using to validate the windows installation. 我们正在使用一个许可证文件来验证Windows安装。 We are using the standard VS setup project to do the installation. 我们正在使用标准的VS安装项目进行安装。

Currently, we are using a test box in the MSI installation to get the license file path, so the user has to manually copy and paste the license file path. 当前,我们在MSI安装中使用测试框来获取许可证文件路径,因此用户必须手动复制并粘贴许可证文件路径。 I want to change this by adding a 'Browse file' button that shows browse file dialog to select license file and auto populates the textbox on selecting the file. 我想通过添加一个“浏览文件”按钮来更改此设置,该按钮显示“浏览文件”对话框以选择许可证文件,并在选择文件时自动填充文本框。

I have used the Orca tool to modify the UI for a adding a button next to the existing textbox in the installation UI. 我已经使用Orca工具来修改UI,以便在安装UI中的现有文本框旁边添加一个按钮。

My question is: Is it possible to write some C# managed code to show, say the Open file dialog to select the license file and then populate the text box. 我的问题是:是否可以编写一些C#托管代码来显示,例如说“打开文件”对话框以选择许可证文件,然后填充文本框。 I understand this is possible by writing C/C++ code. 我知道可以通过编写C / C ++代码来实现。 I see a lot of people using WIX toolset for creating setup files. 我看到很多人使用WIX工具集来创建安装文件。 Right now, I cannot create a new setup installer project because it involves learning WIX and I do not have the time for that now. 现在,我无法创建新的安装程序安装程序项目,因为它涉及到学习WIX,并且我现在没有时间。

I don't believe it is possible. 我不认为有可能。
The out-of-the-box MSI does not support managed code, and therefore you will not be able to write a managed dialog. 开箱即用的MSI不支持托管代码,因此您将无法编写托管对话框。
You can, however, write a bootstrapper to attach a custom graphic interface to your installer. 但是,您可以编写引导程序以将自定义图形界面附加到安装程序。 It is quite complicated, though. 但是,这非常复杂。

I know you wrote you can not convert to WIX in this stage, but I can reassure you that if you know the MSI structure well, learning it will be quite easy. 我知道您写过您不能在此阶段转换为WIX,但我可以向您保证,如果您知道MSI结构,那么学习它将会非常容易。
And than, you can use SharpSetup to create a C# GUI to your installer. 而且,您可以使用SharpSetup为安装程序创建C#GUI。

这是可能的(请参阅DTF之类的工具,该工具可以将.NET代码包装在非托管DLL中),但是对于调用GetOpenFileNameMsiSetProperty的自定义操作的复杂程度,我建议避免对.NET框架的额外依赖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用C#在cmd中以msd身份运行msi安装程序 - How to run msi installer in cmd as admin using C# 在 .msi 安装程序中包装 C# 应用程序 - Wrap C# application in .msi installer 具有C#WPF VS 2015的MSI安装程序 - MSI installer with c# WPF VS 2015 如何在C#安装程序中添加.msi文件 - How to add .msi files in the C# Installer C#使用Transform MST调用和调用MSI,并使用Windows Installer进行其他开关 - C# calling and invoking MSI with a Transform MST, with additional switches using Windows Installer 使用ac#msi安装程序安装时未创建注册表项 - Registry key is not being created upon install using a c# msi installer Windows Installer(.msi)。 自定义动作。 我是否需要混淆/保护用C#编写的自定义操作代码? 有没有办法拆解它? - Windows Installer (.msi). Custom Actions. Do I need to obfuscate/protect Custom Actions code written on C#? Is there a way to disassemble it? 如何在vs2008中更改msi安装程序包的图标,并在为c#项目创建包后更改用户界面屏幕 - How to change icon of msi installer package in vs2008 and change user interface screen after creating package for c# projects 将SaveAsPDF Word插件添加到C#MSI安装程序包中 - SaveAsPDF Word addin in to C# MSI Installer package 从C#安装程序安装程序运行另一个MSI - Run another MSI from C# setup installer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM