如何处理Windows Installer中的复选框控件? [英] How to handle checkbox controls in windows installer?

查看:43
本文介绍了如何处理Windows Installer中的复选框控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2008创建安装项目.我想创建一个文件,其中包含用户在安装过程中选择的复选框的值.如何以及在哪里编写相同的代码?我是Windows安装程序的新手.请为我提供同样的指示.预先谢谢你.

I am using Visual Studio 2008 to create a setup project. I want to create a file which will contain values of the checkboxes which are selected by user during installation. How and where to write the code for the same? I am new to windows installer. Please provide me pointers for the same. Thank you in advance.

推荐答案

您可以使用安装程序类轻松完成此操作.

You can easily do it with installer class.

  1. 首先将安装程序类添加到您的安装项目中.转到添加>添加新项> 选择安装程序类

  1. 使用单选按钮创建一个窗口表单,以获取用户输入和将所选值保存到文本文件的逻辑.

  1. Create a Window Form with radio button to get user input and logic to save selected values to a text file.

在安装程序类的Install方法中,打开Windows窗体以获取用户输入.因此,在安装过程中,将弹出一个窗口,供用户选择值.(请注意,此窗体不会作为模式弹出窗口打开)

Within installer class`s Install method open windows form to get the user input. So during the installation windows form will pop up where user can select the values.(Please not that this form will not open as a modal pop up)

Install()

 public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);

            Form1 form = new Form1();
            form.ShowDialog();
        }

最佳方法

在安装过程中获取用户输入的最佳方法是创建 .wid 文件.请参阅我的帖子此处.

Best approach to get the user input during the installation is to create .wid file. See my post here.

这篇关于如何处理Windows Installer中的复选框控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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