Wix和C#Custom Action [英] Wix and C# Custom Action

查看:82
本文介绍了Wix和C#Custom Action的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CodeProject的社区,



我真的需要你的帮助。实际上我只是建立一个小的Wix设置为依赖检查xna,框架,Windows安装程序。



我使用微软onclick并将它们包含在引导程序中并将其与我的wix设置。这非常好。但现在我需要开始真正的设置。这是我的大问题。



我有这个真正的小wxs文件,包含以下内容



Hi Community of CodeProject,

i really need ur help. Actually im building just an small Wix Setup for a dependecy Check for xna, framework, windows installer.

I Used microsofts onclick and included them into the bootstrapper and combined it with my wix setup. That works really nice. But now i need to start our real setup. And here is my big problem.

I have this real tiny wxs File with the following content

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="07c9c461-7c15-4d1b-a2e3-9101b76e2d0a" Name="test" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="b6c83ebe-ea91-4387-855b-ff434968812d">
    <Package InstallerVersion="200" Compressed="yes" />

    <Binary Id="StartSetup" SourceFile="..\StarttestSetup\bin\Debug\StarttestSetup.CA.dll"/>

    <CustomAction Id="LaunchCGS" BinaryKey="StartSetup" DllEntry="RunSetup" Execute="immediate" Return="check"/>

    <InstallExecuteSequence>
      <Custom Action="LaunchCGS" Before="InstallFinalize"/>
    </InstallExecuteSequence>

  </Product>
</Wix>





这是C#中的自定义操作




And this is the Custom Action in C#

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.WindowsInstaller;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;

namespace StarttestSetup
{
    public class CustomActions
    {
        [CustomAction]
        public static ActionResult RunSetup(Session session)
        {
            session.Log("Begin RunSetup");

            MessageBox.Show("test");

            return ActionResult.Success;
        }
    }
}





这是我的问题。我不知道它真的,但我只能说MessageBox没有出现在屏幕上,没有进程正在运行。所以我认为自定义事件永远不会被触发。但是为什么地狱???



请帮助我,我是Wix的新手,所以它主要是我失败的任何遗漏声明,以便自定义行动可以。 br />


作为方面信息我使用Wix工具集3.5结合VS2010 Professional最新更新。



编译WIX项目完美无误。 Bootstrapper可以正常工作。然后MSI开始但不再发生任何事情。 SO PLS帮助!!!



尼斯问候Synergi



And here is my Problem. I don't know it really but i can only say the MessageBox doesn't appear on the Screen and no Process is running. So I think the Custom Event is never Triggered. BUT WHY THE HELL ???

Pls help me I'm new to Wix so its mostly my failure of any missing declarations so that the Custom Action can becalled.

As side Info im using the Wix toolset 3.5 combined with VS2010 Professional latest updates.

Compiling the WIX Project works perfect without errors. The Bootstrapper works correctly as he should do. The MSI starts then but nothing happens anymore. SO PLS HELP !!!

Nice Regards Synergi

推荐答案

我也是WIX的新手。您是否查看了 WiX教程 [ ^ ]?



另请查看这些文章

使用Wix v3.0,Votive和Visual Studio 2005/2008创建安装程序 [ ^ ]

Wix#(WixSharp) - WiX的托管界面 [ ^ ]
I'm also new to WIX. Did you check the WiX Tutorial[^]?

Also check these articles
Creating an installer using Wix v3.0, Votive, and Visual Studio 2005/2008[^]
Wix# (WixSharp) - managed interface for WiX[^]


该死的愚蠢,但在任何方面都可以理解。如果安装程序中没有包含MSI的真实文件的组件将永远不会进入InstallExeceuteSequence,因为它不会安装任何内容。它就是这样。 DAMN IT x)
Its damn Stupid but in any ways understandable. If the is no Component in the Installer with a real File containing the MSI will never get into InstallExeceuteSequence because it installs nothing. SO it is. DAMN IT x)


您好,

您需要在< installuisequence>中添加自定义操作。另外。



但是看看你的问题似乎还有很长的路要走。

为什么不在MSI中添加二进制文件它不包含在MSI中的文件列表中。使用自定义操作提取它并写入临时位置并使用该文件。



实现已在我的博客,如果需要,可以参考。
Hi,
You need to add your custom action in <installuisequence> also.

But looking at your question seems you are taking a long way around.
Why not you add the file in binary in MSI which is not included in the list of files in MSI. the use the custom action to extract it and write in temp location and use that file.

Implementation is been described at my blog, you can refer it if you want.


这篇关于Wix和C#Custom Action的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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