Wix and C#

5 messages Options
Embed this post
Permalink
Joanne Paul

Wix and C#

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hi,

I am sorry to botter you but I have a question concerning wix.

I want to call a DLL

I created a wxs file containing the following lines

<InstallExecuteSequence>
<Custom Action="MyCustomAction" Sequence="1" />
</InstallExecuteSequence>
<Binary Id="MyCustomAction.dll" SourceFile="C:\Developpement\wix tutorial\InstallationTarget\CustomAction1\bin\Debug\CustomAction1.CA.dll" />
<CustomAction Id="MyCustomAction" BinaryKey="MyCustomAction.dll" DllEntry="CustomAction1" Execute="deferred" />


and I have my C# class as the following


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

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

System.Windows.Forms.MessageBox.Show("Passe dans customAction1");

return ActionResult.Success;
}
}
}


but it wont show my message box when I execute the msi. Could you please tell me what is wrong in my way of doing things.
Help will be appreciated.
Tanks in advance

Joanne Paul


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
DEÁK JAHN, Gábor-2

Wix and C#

Reply Threaded More More options
Print post
Permalink
On Fri, 22 Aug 2008 10:13:52 -0400, Joanne Paul wrote:

Joanne,

> but it wont show my message box when I execute the msi. Could you
> please tell me what is wrong in my way of doing things.

Using C# is the problem. You have to use a native Win32 DLL for a custom action, not managed .NET code. This is an ongoing debate because more and more programmers are .NET-only (which is, but this is strictly my personal opinion, a very big problem, programmers have to know several languages, including C, C++ and Pascal and similar to call themselves programmers but I digress) and .NET does offer a nice, cosy environment to do things in. Still, this is not an arbitrary limitation, it has it reasons. See http://www.tramontana.co.hu/wix/lesson3.php#3.5 for a short description and a link to Rob's blog detailing the issue.

Bye,
   Gábor

-------------------------------------------------------------------
DEÁK JAHN, Gábor -- Budapest, Hungary
E-mail: [hidden email]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
Jason Ginchereau

Re: Wix and C#

Reply Threaded More More options
Print post
Permalink
In reply to this post by Joanne Paul
Some javascript/style in this post has been disabled (why?)

Deferred CAs must  be scheduled between the InstallInitialize and InstallFinalize actions. Your CA has a sequence of 1, which places it before InstallInitialize.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Joanne Paul
Sent: Friday, August 22, 2008 7:14 AM
To: [hidden email]
Subject: [WiX-devs] Wix and C#

 

Hi,

I am sorry to botter you but I have a question concerning wix.

I want to call a DLL

I created a wxs file containing the following lines

<InstallExecuteSequence>
<Custom Action="MyCustomAction" Sequence="1" />
</InstallExecuteSequence>
<Binary Id="MyCustomAction.dll" SourceFile="C:\Developpement\wix tutorial\InstallationTarget\CustomAction1\bin\Debug\CustomAction1.CA.dll" />
<CustomAction Id="MyCustomAction" BinaryKey="MyCustomAction.dll" DllEntry="CustomAction1" Execute="deferred" />


and I have my C# class as the following


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

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

System.Windows.Forms.MessageBox.Show("Passe dans customAction1");

return ActionResult.Success;
}
}
}


but it wont show my message box when I execute the msi. Could you please tell me what is wrong in my way of doing things.
Help will be appreciated.
Tanks in advance

Joanne Paul


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
Jason Ginchereau

Re: Wix and C#

Reply Threaded More More options
Print post
Permalink
In reply to this post by DEÁK JAHN, Gábor-2
Actually, you're a little behind on the news. Since a few months ago, WiX has included Deployment Tools Foundation which fully supports managed custom actions while solving the technical issues. See Rob's newer blog post here: http://robmensching.com/blog/archive/2008/05/16/Deployment-Tools-Foundation-joins-the-WiX-toolset.aspx


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of DE?K JAHN, G?bor
Sent: Sunday, August 24, 2008 5:57 AM
To: Windows Installer XML toolset developer mailing list
Subject: [WiX-devs] Wix and C#

On Fri, 22 Aug 2008 10:13:52 -0400, Joanne Paul wrote:

Joanne,

> but it wont show my message box when I execute the msi. Could you
> please tell me what is wrong in my way of doing things.

Using C# is the problem. You have to use a native Win32 DLL for a custom action, not managed .NET code. This is an ongoing debate because more and more programmers are .NET-only (which is, but this is strictly my personal opinion, a very big problem, programmers have to know several languages, including C, C++ and Pascal and similar to call themselves programmers but I digress) and .NET does offer a nice, cosy environment to do things in. Still, this is not an arbitrary limitation, it has it reasons. See http://www.tramontana.co.hu/wix/lesson3.php#3.5 for a short description and a link to Rob's blog detailing the issue.

Bye,
   G?bor

-------------------------------------------------------------------
DE?K JAHN, G?bor -- Budapest, Hungary
E-mail: [hidden email]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
DEÁK JAHN, Gábor-2

Wix and C#

Reply Threaded More More options
Print post
Permalink
On Tue, 26 Aug 2008 10:12:28 -0700, Jason Ginchereau wrote:

Jason,

> Actually, you're a little behind on the news.

I obviously am. I've already changed those parts in the tutorial and will try to locate some samples to illustrate its use when I'll have a little time to spare. Thanks.

Bye,
   Gábor

-------------------------------------------------------------------
DEÁK JAHN, Gábor -- Budapest, Hungary
E-mail: [hidden email]


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs