如何修改Visual Studio Installer Project的对话框? [英] How to modify the dialogs of Visual Studio Installer Project?

查看:218
本文介绍了如何修改Visual Studio Installer Project的对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010创建安装程序。所有功能都可以与安装程序一起使用。但我想在此做一些额外的事情。由于用户可以更改安装目录,我在[SELECTEDDIR] \ MYAPP文件夹中安装应用程序。但问题是当用户选择位置例如F:\时,GUI的位置框只显示F:\但我想显示F:\ MYYP。如何实现这个目标?



编辑:

我在代码中的BrowseDlg中完成了以下操作。但它不工作它仍然没有在位置文本中显示附加的文件夹名称。



 <! -    <浏览Dlg>    - >   
< 对话 < span class =code-attribute> Id = BrowseDlg1 宽度 = 370 高度 = 270 标题 = [P roductName]设置 NoMinimize = >

< 控制 Id = PathEdit < span class =code-attribute>类型 = PathEdit X = 84 Y = 202 宽度 = 261 高度 = 18

< span class =code-attribute> 属性 = _ BrowseProperty 间接 = / >

< 控制 Id = 确定 类型 = PushButton < span class =code-attribute> X = 304 Y = 243 宽度 = 56 高度 = 17

默认 = 文字 = [ButtonText_OK] >
< 发布 事件 = SetTargetPath = [_ BrowseProperty] [FolderCust] > 1 < / Publish >
< 发布 事件 = EndDialog Value = 返回 > 1 < / Publish >
< / Control >

< 控制 Id = 取消 类型 = PushButton < span class =code-attribute> X = 240 Y = 243 宽度 = 56 高度 = 17

< span class =code-attribute> 取消 = 文本 = [ButtonText_Cancel] >
< 发布 事件 = 重置 = 0 > 1 < / Publish >
< 发布 事件 = < span class =code-keyword> EndDialog = 返回 > 1 < / Publish >
< / Control >

< 控制 Id = ComboLabel 类型 = 文本 X = 25 Y = 58 < span class =code-attribute>宽度 = 44 高度 = 10

TabSkip = no 文字 = 查找: / >

< 控制 Id = DirectoryCombo 类型 = DirectoryCombo X < span class =code-keyword> = 70 Y = 55 宽度 = 220 高度 = 80

属性 = _ BrowseProperty 间接 = < span class =code-attribute> 已修复 = yes 远程 = >
< 订阅 事件 = IgnoreChange 属性 = IgnoreChange / >
< / Control >

< 控制 Id = 向上 类型 = PushButton X = 298 Y = 55 宽度 = 19 高度 = 19

工具提示 = 向上一级 图标 = no 合菜dSize = IconSize = 16 文字 = 向上 >
< 发布 事件 = DirectoryListUp = 0 > 1 < span class =code-keyword>< / Publish >
< / Control > ;

< 控制 Id = NewFolder 类型 = PushButton X = 325 Y = 55 宽度 = 19 高度 = 19

工具提示 = 创建新文件夹 图标 = no FixedSize = IconSize = 16 文字 = >
< 发布 事件 = DirectoryListNew = 0 > 1 < / Publish >
< / Control >

< 控制 Id = DirectoryList 类型 = DirectoryList X = 25 Y = 83 宽度 = 320 高度 = 110

属性 = _ BrowseProperty 沉没 = 间接<​​/ span> = TabSkip = no / >

< 控制 Id = 返回 类型 = PushButton X = 180 Y = 243 宽度 = 56 Heig ht = 17

文字 = [ButtonText_Back] >
< 发布 事件 = NewDialog = CustomizeDlg1 > 1 < / Publish >
< / Control >

< / Dialog >





EDITED2:目录层次结构代码如下所示

 <  目录    Id   =  TARGETDIR   名称  =  SourceDir  >  
< 目录 Id = ProgramFilesFolder >
< 目录 Id = CompanyFolder 名称 = 我的公司 >
< 目录 Id = KONASECUREPASSFOLDER 名称 = KonaSecurePass >
< 目录 Id = INSTALLLOCATION 名称 = isWixProject >
<! - < Merge Id =isWixProjectMMSourceFile =$(var.isWixProjectMM。 TargetPath)DiskId =1Language =1033/> - >
< /目录 >
< /目录 >
< /目录 >
< /目录 >
< < span class =code-leadattribute> / Directory >

解决方案

(var.isWixProjectMM.TargetPath)DiskId =1Language =1033/> - >
< /目录 >
< /目录 >
< /目录 >
< /目录 >
< /目录 >


< blockquote>

Naseef-Ur-Rahman写道:



是的,安装项目与Visual Studio捆绑在一起。

帮自己一个大忙,听听我友善的建议:抛弃这个垃圾。由于一些非常好的理由,这个项目类型已经停止给微软,甚至对Visual Studio也不合法。



这一天,真正合法的产品是开源的(第一个微软的开源产品)WiX(目前由微软赞助的Outercurve基金会提供,由Microsoft Reciprocal License提供):

http://en.wikipedia.org/wiki/WiX

http:// wixtoolset。 org /

http://wix.codeplex.com/



这是我所知道的唯一正确与MSBuild集成并完全符合MSBuild项目标准的产品。你提到的问题听起来很荒谬。我知道,因为我自己使用它。







这是一个非常基本的文件用户输入的目标目录: http://wixtoolset.org/documentation/manual/v3/wixui /dialog_reference/wixui_installdir.html



我建议您在自己提出更多问题之前阅读WiX文档并在网上搜索您关注的信息。开发者社区积极分享了很多解决方案,但你的问题非常标准。



-SA


I am creating an installer using Visual Studio 2010. All feature works fine with the installer. But I want to do some additional things on this. As users can change the installation directory, I am installing the app in [SELECTEDDIR]\MYAPP folder. But the problem is when user selects the location for example F:\ then the location box of the GUI only shows F:\ but I want to show "F:\MYAPP". How to accomplish this?

EDITED:
I have done the following in BrowseDlg in my code. but it is not working it still doesn't shows the appended folder name in the location text.

<!--<Browse Dlg>-->
      <Dialog Id="BrowseDlg1" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
        
        <Control Id="PathEdit" Type="PathEdit" X="84" Y="202" Width="261" Height="18"

          Property="_BrowseProperty" Indirect="yes" />

        <Control Id="OK" Type="PushButton" X="304" Y="243" Width="56" Height="17"

   Default="yes" Text="[ButtonText_OK]">
          <Publish Event="SetTargetPath" Value="[_BrowseProperty][FolderCust]">1</Publish>
          <Publish Event="EndDialog" Value="Return">1</Publish>
        </Control>

        <Control Id="Cancel" Type="PushButton" X="240" Y="243" Width="56" Height="17"

          Cancel="yes" Text="[ButtonText_Cancel]">
          <Publish Event="Reset" Value="0">1</Publish>
          <Publish Event="EndDialog" Value="Return">1</Publish>
        </Control>

        <Control Id="ComboLabel" Type="Text" X="25" Y="58" Width="44" Height="10"

    TabSkip="no" Text="Look in:" />

        <Control Id="DirectoryCombo" Type="DirectoryCombo" X="70" Y="55" Width="220" Height="80"

          Property="_BrowseProperty" Indirect="yes" Fixed="yes" Remote="yes">
          <Subscribe Event="IgnoreChange" Attribute="IgnoreChange" />
        </Control>

        <Control Id="Up" Type="PushButton" X="298" Y="55" Width="19" Height="19"

    ToolTip="Up One Level" Icon="no" FixedSize="yes" IconSize="16" Text="Up">
          <Publish Event="DirectoryListUp" Value="0">1</Publish>
        </Control>

        <Control Id="NewFolder" Type="PushButton" X="325" Y="55" Width="19" Height="19"

          ToolTip="Create A New Folder" Icon="no" FixedSize="yes" IconSize="16" Text="New">
          <Publish Event="DirectoryListNew" Value="0">1</Publish>
        </Control>

        <Control Id="DirectoryList" Type="DirectoryList" X="25" Y="83" Width="320" Height="110"

    Property="_BrowseProperty" Sunken="yes" Indirect="yes" TabSkip="no" />

        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17"

  Text="[ButtonText_Back]">
          <Publish Event="NewDialog" Value="CustomizeDlg1">1</Publish>
        </Control>

      </Dialog>



EDITED2: Directory hierarchy code is shown below

<Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="CompanyFolder" Name="My Company">
          <Directory Id="KONASECUREPASSFOLDER" Name="KonaSecurePass">
            <Directory Id="INSTALLLOCATION" Name="isWixProject">
              <!--<Merge Id="isWixProjectMM" SourceFile="$(var.isWixProjectMM.TargetPath)" DiskId="1" Language="1033"/>-->
            </Directory>
          </Directory>
        </Directory>
      </Directory>
    </Directory>

解决方案

(var.isWixProjectMM.TargetPath)" DiskId="1" Language="1033"/>--> </Directory> </Directory> </Directory> </Directory> </Directory>


Naseef-Ur-Rahman wrote:


Yes the setup project is bundled with Visual Studio.

Do yourself a big favor and listen to my good friendly advice: throw out this trash. This project type is discontinued to Microsoft, by some very good reasons, and is not even legitimate to Visual Studio.

These day, the really legitimate product is open-source (first Microsoft's open-source product) WiX (presently provided by Microsoft-sponsored Outercurve Foundation, by Microsoft Reciprocal License):
http://en.wikipedia.org/wiki/WiX,
http://wixtoolset.org/,
http://wix.codeplex.com/.

This is the only product I know correctly integrated with MSBuild and fully compliant with MSBuild project standard. The problem you mentioned would sound ridiculous. I know because I using it myself.

[EDIT]

This is a very basic document on the user-entered target directory: http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_installdir.html.

I suggest you read WiX documentation and just search information on your concern on the Web, before you ask further questions yourself. Community of developers actively shares a lot of solutions, but your problem is very standard.

—SA


这篇关于如何修改Visual Studio Installer Project的对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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