65.9K
CodeProject 正在变化。 阅读更多。
Home

使用功能/选择树插件完成 VS2008/VS2010 安装项目

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.77/5 (20投票s)

2009年8月20日

CPOL

2分钟阅读

viewsIcon

106234

downloadIcon

1723

此插件为 VS 2008 增加了一个新的“选择功能”对话框,用于管理功能。

引言

插件 为 VS 2008 增加了一个新的 选择功能 对话框,用于管理 功能。该插件会检查安装程序项目是否存在 选择功能 对话框。如果存在该对话框,它会修改 MSI 文件,并将其放置在 Dialog-Property 中。结果会显示在 输出 窗口中。新的 SelectionFeature(VsdSelectionTreeDlg.wid) 对话框使用了 Installer-Control SelectionTree 的功能。此对话框针对中性语言、美式英语和德语进行了草图绘制,对于其他语言,必须使用 Orca 复制一份并进行适配。此外,必须在 ModuleSignature 表中的 Language 字段中调整语言(例如,德语为 1031,英语为 1033)。对话框位于目录 C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\Deployment\VsdDialogs\0, ..1031, ..1033... 中。

背景

在安装程序项目中选择组件的功能仅由专业的安装程序编辑器提供,VS 2008 不提供此功能。

使用对话框

使用 MSI 文件安装 SelectionTree。 它会将三个文件 VsdSelectionTreDlg_0.widVsdSelectionTreDlg_1031.widVsdSelectionTreDlg_1033.wid 安装为 VsdSelectionTreDlg.wid,安装到上述目录中。它还会安装 AddIn。

在安装程序项目中,选择新的 选择功能 对话框,然后确定参数功能。

The SelectionTree

将单个文件添加到项目,或者先将多个文件汇总到 Mergemodule 中,然后插入此模块。总共可以插入 9 个功能。 然后,如果它是单个文件,则在“文件”字段中的 SelectionTree 中插入文件名。

Mergemodule

或者,如果您输入 Mergemodule,则插入来自 MergemoduleModuleSignature 的 Guid 部分。给出使用的功能和合适的参数的编号。填写标题、描述和目录。 另请参阅...

Level

选择级别。

Parent

选择父级。

Level

选择显示。

关注点

对于输出,使用输出窗口中的消息 PropertyChangedEventArgs

#region PropertyChanged
    // INotifyPropertyChanged - Event treatment
    public event PropertyChangedEventHandler PropertyChanged;
    
    private void NotyPropertyChanged(string info)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
#endregion

#region Info

    // Help variables for announcements
    OutputWindowPane owP = null;
    private string ErrorText = "{0} **** {1}";
    private ResourceManager rm = new ResourceManager
	("InsertFeature.InsertFeature", Assembly.GetExecutingAssembly());
    
    /// 
    /// Gives by every change with Debug. Print the contents from
    /// 
    private string _LastErrorText = null;
    public string LastErrorText
    {
       get { return _LastErrorText;}
       set 
       { 
           _LastErrorText = value;
           owP.OutputString(_LastErrorText + "\n");
           owP.ForceItemsToTaskList();
        }
     }
#endregion

LastErrorText = string.Format
		(ErrorText, "ERROR", rm.GetString("LastErrorText001", culture));

新增功能?

现在界面是英语和德语。它可以通过自己的字符串资源翻译成您的文化。请将您从 InsertFeature.xx-XX.resxVsdSelectionTreeDlg.wid 的翻译发送给我。

历史

  • 2009 年 8 月 20 日 - 首次初始版本
  • 2009 年 8 月 25 日 - 为中性语言(英语)和美式英语添加了新对话框
  • 2009 年 8 月 26 日 - 移除安装 SelectionTree 时发生的错误
  • 2010 年 3 月 5 日 - 界面和消息为英语,并提供使用其他语言的选项。 请插入新的 InsertFeature.es-ES.resxInsertFeature.fr-FR.resx 等。
  • 2010 年 10 月 28 日 – 用于 VS2008 和 VS2010 的新安装程序
  • 2010 年 11 月 12 日 - 添加了 VS2010 的源代码
  • 2011 年 3 月 28 日 - 更新了下载 VS2010 安装程序
© . All rights reserved.