Click here to Skip to main content
14,738,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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>


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;
        }
    }
}


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
Posted
Comments
SynergiAios 1-Feb-12 5:13am
   
Ok guys I now explain what i did exactly because I really need ur help. Maybe then one of u guys can check it to see what I did wrong.

First lets start with the Tools:

I use VS2010 Professional (latest Updates) and WIX Toolset 3.5 (Latest stable)

-----------------

1) In VS2010 I create a new WIX Setup Project lets call it test.
2) In this Solution I add another new Project of the Type CUSTOM C# Action lets call it CustomAction1
3) In this Custom Action I add the reference to System.Windows.Forms and then underneath the StartLogging Argument I add a MessageBox.SHow("test");
4) I build the CustomAction1 Project to get the DLL's
5) Back to the WIX Setup Project i go to the Tag underneath the Prdouct Tag. There i Define a Fragment Tag.
6) In the Fragment Tag i define a CustoAction Tag with the following options:

Id="test"
BinaryKey="testBinary"
DllEntry="CustomAction1"
Execute="immediate"
Return="check"

These are the Settings for the Custom Action.
7) Underneath the CustomAction Tag i define a Binary tag with these Options:

Id="testBinary"
SourceFile="../CustomAction1/bin/Debug/CustomAction1.dll"

And that was it.
8) Then i add in the Product Tag a InstallExecuteSequence Tag.
9) In this Tag i add a Custom Tag with the following Options:

Action="test"
Before="InstallFinalize"

10) I click on build the complete Solution. Everything fine no Errors all success.

------------------

When i start then the msi it is decompressed to the Temp and then executed. Quickly the Window disapears but NO MESSAGEBOX !!! Why the hell.

This is done like in Many Tutorials explained. I tried it also with VS2008 and Toolset 3.5 Nothing changed. PLS GUYS NEED HELP

   
Comments
SynergiAios 31-Jan-12 13:32pm
   
Thx for ur articels Wix# is new to me. But about the Tutorials and HowTo's the sad thing is this really minimal Code is out of many Tutorials. I have tried about 7 or so and i wasn't able to achive my goal with any of them. I do sth wrong but i actually dont know what x) Hopefully anyone can say me what
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)
   
Comments
barneyman 17-Jun-12 3:34am
   
Can you not create a component with a regkey entry (Registry Table'?

I don't personally use Wix, I use an analogue of it i wrote some years ago
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.
   
Instead of this ::

Id="testBinary"
SourceFile="../CustomAction1/bin/Debug/CustomAction1.dll"



Try this :
Id="testBinary"
SourceFile="../CustomAction1/bin/Debug/CustomAction1.CA.dll"
   
Comments
Kornfeld Eliyahu Peter 23-Jun-14 7:05am
   
Posting answer to a two years old, already solved question will not get you too far...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900