【问题标题】:Launching .vsto file after installation. (InstallShield)安装后启动 .vsto 文件。 (安装盾牌)
【发布时间】:2012-02-08 20:46:47
【问题描述】:

我有一个通过 InstallShield 制作的 msi 安装程序,它将一些文件移动到所需位置, 将一些信息写入注册表并安装 VSTO 运行时。但是我需要在安装结束后启动与应用程序一起安装的 .vsto 文件。我可以使用自定义操作来做到这一点吗?如果该文件是 .exe 文件,那将相当容易,但我如何启动 .vsto 文件呢?
[更新]

好吧,也许有一个更简单的解决方案: 我可以直接调用函数吗:
public override void Install(IDictionary stateSaver)
来自 InstallShield?像这样的东西: 自定义操作->调用 Windows Installer 动态链接库中的函数->存储在二进制表中=>
AssemblyFile = \InclusionListCustomActions.dll MethodSignature = InclusionListCustomActions.TrustInstaller.Install(但是这里的参数是什么?)

【问题讨论】:

  • 为什么要启动 .vsto 文件?
  • 这是 Microsoft Office Outlook 的插件。以前版本的安装程序是在 Visual Studio 中制作的,但由于某种原因,我们需要将用于创建安装程序的工具更改为 InstallShield。在 VS 中,此操作是使用 CustomActionData 属性进行的,我不知道如何在 InstallShield 中进行。
  • 我已经写了很多关于这个主题的博客文章。 Google VSTO 经验教训。

标签: vsto installshield


【解决方案1】:

您不应启动 VSTO 文件,因为这只会为每个用户安装它。您应该做的是将它添加到您需要的办公应用程序的 AddIns 注册表项中,并使用 |vstolocal 属性告诉它不要部署到单击一次缓存。

【讨论】:

    【解决方案2】:

    您可以按照http://msdn.microsoft.com/en-us/library/cc563937%28v=office.12%29.aspx中描述的步骤进行操作,您可以在Installshield中复制相同的步骤,复制文件并按照指定设置注册表值后,在启动Office应用程序时它将自动拾取vsto文件

    要将信息添加到包含列表中,您必须编写一个控制台应用程序,然后从 installshield 调用控制台应用程序。下面的代码会有所帮助

                string RSA_PublicKey = @"<RSAKeyValue><Modulus></Modulus></RSAKeyValue>";
                //get this key from .vsto file
                try
                {
                    SecurityPermission permission =
                        new SecurityPermission(PermissionState.Unrestricted);
                    permission.Demand();
                }
                catch (SecurityException)
                {
                    Console.WriteLine(
                        "You have insufficient privileges to " +
                        "register a trust relationship. Start Excel " +
                        "and confirm the trust dialog to run the addin.");
                    Console.ReadLine();
                }
                Uri deploymentManifestLocation = null;
                var excelPath = YourAPPPath;              
                if (Uri.TryCreate(excelPath,
                    UriKind.RelativeOrAbsolute, out deploymentManifestLocation) == false)
                {
                    Console.WriteLine(
                        "The location of the deployment manifest is missing or invalid.");
                    Console.ReadLine();
                }
    
                if (!File.Exists(excelPath))
                {
                    UserInclusionList.Remove(deploymentManifestLocation);
                    Console.WriteLine(deploymentManifestLocation.ToString() + "removed from inclusion list");
    
                }
                else
                {
                    AddInSecurityEntry entry = new AddInSecurityEntry(
                              deploymentManifestLocation, RSA_PublicKey);
                    UserInclusionList.Add(entry);
                    Console.WriteLine(deploymentManifestLocation.ToString() + "Added to inclusion list");                  
                }
    

    【讨论】:

    • 是的,感谢这篇文章,但问题仍然存在。如您所见,文章中有一个标签:“在属性窗口中,将 CustomActionData 属性的值设置为 /deploymentManifestLocation="[TARGETDIR]ExcelAddIn.vsto"。” 问题在于InstallShield 在自定义操作中没有此属性。
    • 你可以在更新的代码中做类似的事情,它应该服务于文章中描述的自定义自定义操作的目的
    猜你喜欢
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    • 2011-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多