在 %ProgramFiles%\Microsoft Visual Studio 8\Common7\Tools\Deployment\VsdDialogs\1033 目录下提供丰富的安装对话框,
其中就有选择路径的,可就是没有选择文件的,还好我们可以借助orca工具来编辑属于自己的对话框。
1. 在%ProgramFiles%\Microsoft Visual Studio 8\Common7\Tools\Deployment\VsdDialogs\0目录下,拷贝VsdConfirmDlg.wid
(VsdConfirmDlg.wid没有多余控件,方便操作),将其命名为“BrowseFileDlg.wid”。借助orca工具,打开文件。
2.右键点击,选择添加表,添加Binary 和CustomAction表
3.导入DLL(该DLL使用C++编写,出自 http://www.installsite.org/pages/en/msi/ca.htm)下载
4.注册该DLL,Action为触发事件名称,外部DLL type 须为1,Source 为 binary 表的名称,Target为DLL的方法名称
5.在control表中添加button控件和Text控件
6.在controlEvent中关联button和Text直接联系
7.保存该操作,使用orca生成一个GUID
8.将该文件同时复制到%ProgramFiles%\Microsoft Visual Studio 8\Common7\Tools\Deployment\VsdDialogs\1033
9.建立一个安装项目,添加Browse File对话框,导入一个安装类工程,其Installer 类负责解析选择的文件路径,就是 PATHTOFILE参数
this.Context.Parameters["edit1"];
10.最终效果
BrowseFileDlg.wid文件下载
参考 http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx
其中就有选择路径的,可就是没有选择文件的,还好我们可以借助orca工具来编辑属于自己的对话框。
1. 在%ProgramFiles%\Microsoft Visual Studio 8\Common7\Tools\Deployment\VsdDialogs\0目录下,拷贝VsdConfirmDlg.wid
(VsdConfirmDlg.wid没有多余控件,方便操作),将其命名为“BrowseFileDlg.wid”。借助orca工具,打开文件。
2.右键点击,选择添加表,添加Binary 和CustomAction表
3.导入DLL(该DLL使用C++编写,出自 http://www.installsite.org/pages/en/msi/ca.htm)下载
4.注册该DLL,Action为触发事件名称,外部DLL type 须为1,Source 为 binary 表的名称,Target为DLL的方法名称
5.在control表中添加button控件和Text控件
6.在controlEvent中关联button和Text直接联系
7.保存该操作,使用orca生成一个GUID
8.将该文件同时复制到%ProgramFiles%\Microsoft Visual Studio 8\Common7\Tools\Deployment\VsdDialogs\1033
9.建立一个安装项目,添加Browse File对话框,导入一个安装类工程,其Installer 类负责解析选择的文件路径,就是 PATHTOFILE参数
this.Context.Parameters["edit1"];
10.最终效果
BrowseFileDlg.wid文件下载
参考 http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx