在 Visual Studio 2017 中使用 .wid 文件 [英] Use .wid files with Visual Studio 2017

查看:83
本文介绍了在 Visual Studio 2017 中使用 .wid 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Studio 2017 Professional 创建了一个安装项目(.vdproj 文件).我想使用本页中建议的密码对话框:

解决方案

他们在:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\VSI\bin\VsdDialogs\1033

在我的系统上.如果您根本找不到任何 .wid 文件,那可能是因为安装程序项目扩展是一个单独的加载项,从这里:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

.wid 文件基本上是包含在 MSI 文件中的合并模块,而该 CodeProject 文章中的 .wid 文件只是在控件属性中设置了密码位的标准编辑对话框之一.换句话说,您可以通过这种方式获得相同的结果:

  1. 选择要安装的附加对话框,在本例中,我将使用 TextBoxes (C).构建 MSI 文件.

  2. 使用 Orca 打开 MSI 文件,然后转到控制表.单击 Dialog 标题进行排序,然后查看 CustomTextC 对话框条目.Edit2 和 Edit4 将是两个密码条目(因为 Edit1 和 Edit3 在此示例中是用户名).Attributes 值为 7,将其更改为 2097159,因为您只是在此处添加值使其成为密码控件:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa368042(v=vs.85).aspx

  1. 保存您的 MSI 文件.

所以在那篇文章中,作者复制了一个 TextBoxes .wid 文件,使用 Orca 等 MSI 文件编辑器打开它,转到控制表,进行我刚刚所做的更改,然后将其另存为新的 .wid文件.如果您不想编辑您的 MSI 文件,您可以做完全相同的事情.

I have created a Setup Project with Visual Studio 2017 Professional (.vdproj file). I would like to use a Password Dialog as suggested in this page:

https://www.codeproject.com/Tips/659367/Password-Dialog-for-Visual-Studio-Deployment-Proje

This tutorial has been written for Visual Studio 2012 and it's working great, putting the file VsdUsernamePasswordDlg.wid into this folder:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Deployment\VsdDialogs\1033"

But I can't find the right place to put this file to use it with Visual Studio 2017.


EDITED 09.10.2017

I followed the instructions given by PhilDW but when I try to compile the Setup Project I get this error: ERROR: No such interface supported.

I can't see the Password Dialog among the possible choices:

解决方案

They are in:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\VSI\bin\VsdDialogs\1033

on my system. If you cannot find any .wid files at all it's probably because the installer project extension is a separate add-in, from here:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

A .wid file is basically a merge module that gets included into the MSI file, and the .wid file in that CodeProject article is just one of the standard edit dialogs that has the password bit set in the attributes of the control. In other words you can achieve the same result in this way:

  1. Choose the additional dialog you want to install, and in this example I will use TextBoxes (C). Build the MSI file.

  2. Open the MSI file with Orca, and go to the Control table. Click on the Dialog heading to sort, then look at the CustomTextC dialog entries. Edit2 and Edit4 will be the two password entries (because Edit1 and Edit3 are usernames in this example). The Attributes value will be 7, change it to 2097159, because you are just adding the value here that makes it a password control:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa368042(v=vs.85).aspx

  1. Save your MSI file.

So in that article the author copied one of the TextBoxes .wid files, opened it with an MSI file editor such as Orca, went to the Control table, made the changes I just made, then saved it as a new .wid file. You can do exactly the same thing if yoi don't want to edit your MSI file.

这篇关于在 Visual Studio 2017 中使用 .wid 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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