Use .wid files with Visual Studio 2017

风格不统一 提交于 2021-02-08 03:06:04

问题


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:


回答1:


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.




回答2:


To complete the answer from PhilDW I write here the solution to use .wid in .vdproj projects in VS 2013 and 2017. You have to put them into:

Visual Studio 2017

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

Where VS_Version is the name of your VS Version: Community, Professional etc.

Visual Studio 2013

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



来源:https://stackoverflow.com/questions/46609209/use-wid-files-with-visual-studio-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!