[wix-users] CSharp Wix Custom Action not fired.

Ronny Eriksson ronny.eriksson at optimity.se
Mon Mar 26 09:22:54 PDT 2018


Okay.

So yes, it does not look like you get your dll in to the MSI.
I don't think that it is enough to have it aside your MSI when running the MSI, I think you need it inside you MSI.

So what I do is that I have everything in the same solution in VS.
So both the WIX MSI project and the CustomerAction is in the same Solution.
Then I add the CustomAction Project as a Resource in the WIX MSI project.
That way the CustomAction Project is build when the WIX MSI built and the DLL is incorporated in to the MSI file.
Then I set my CustomAction in the WXS file to this
<Binary Id="CustomAction" SourceFile="$(var. CustomAction.TargetDir)CustomAction.CA.dll" />
This "$(var. CustomAction.TargetDir)" should get the path to your CustomAction.dll that has just been built and when the WIX is build it will pack it and attached resources that project has into the your MSI.
Try that and see if that works better, it works for me atleast.

Just so you know, I'm no expert what so ever on WIX, this is just what I have learned by trial and error and ALOT of reading and testing.

Ronny Eriksson | Technical Consultant, Optimity Europe| +46 706 809 832 | www.optimitysoftware.com       
Sign up to the Optimity Newsletter

IMPORTANT – This e-mail and any attachments may be confidential and privileged. If received in error, please contact us and delete all copies. Before opening or using attachments, check them for viruses and defects. Our liability is limited to re-supplying any affected attachments. Any use or dissemination of its contents in any forms by anyone other than the addressee is prohibited.

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Matsumoto Chihiro via wix-users
Sent: den 26 mars 2018 10:17
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Matsumoto Chihiro <illuminate33 at hotmail.com>
Subject: Re: [wix-users] CSharp Wix Custom Action not fired.

Thank you for your kind advice, Ronny.


I changed my wxs file following your advice.

1:CustomAction tag [Return="check" Execute="immediate"] to     [Execute="firstSequence"]

2:I removed [Indirect="yes"] attribute in textbox UI="Edit".


But I cannot find any difference.


Verbose log before the change is below.

https://drive.google.com/file/d/1FOnhwU8LWmntuoMIT6LlrXEN_EFRp8-U/view?usp=sharing


Verbose log after the change is below.

https://drive.google.com/file/d/1XCofeGL7GdGZ1lQQSItTjF44dGGMllDf/view?usp=sharing


I put on CustomAction1.CA.dll to the directory where the msi file exists. Currently what I most suspect in my wxs file is the Binary SourceFile attribute="SourceDir\CustomAction1.CA.dll"(I only want to make directory structure simple) because msi works as if it cannot find the dll... msi works same even if I remove the dll file in the folder.

I am not sure Visual Studio solution explorer directory structure affects msi runtime operation. I copy and paste the dll to msi folder manually.

Any ideas?

________________________________
差出人: wix-users <wix-users-bounces at lists.wixtoolset.org> が Ronny Eriksson via wix-users <wix-users at lists.wixtoolset.org> の代理で送信
送信日時: 2018年3月26日 16:11
宛先: WiX Toolset Users Mailing List
CC: Ronny Eriksson
件名: Re: [wix-users] CSharp Wix Custom Action not fired.

Hi

I have almost the exact same feature you are trying to  do, and mine works just fine.
The things I can see that is different is the following You have Return="check" Execute="immediate" in your CustomAction setup in the .wxs file and I only have this Execute="firstSequence".
I only want mine to do it on that specific dialog and no where else.

In your UI control "Edit" you have Indirect="yes", I never got that working so I removed it, but you might need that if your Property is connected to another Property And at last I have a Publish after the DoAction on you button control that sets the value to the property.

You are using VS 2010 and I'm using 2015.
I'm using the lasts Wix version.

I don’t see why the wix version should be a problem since I just updated to that version and was using version 3.10 before.
VS 2010 should work but might be worth testing.
The difference in the .wxs file might be the one but I'm not sure.
I don't think that you CustomeAction.cs is the problem.

You could try running the MSI with verbose logging, that way you will see if the property SETUPEXEPATH is set correctly.

/Ronny Eriksson

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Matsumoto Chihiro via wix-users
Sent: den 26 mars 2018 03:56
To: wix-users at lists.wixtoolset.org
Cc: Matsumoto Chihiro <illuminate33 at hotmail.com>
Subject: [wix-users] CSharp Wix Custom Action not fired.

Hello:

I (Newbie of Wix) posted a question again about Csharp custom action in Stackoverflow, no answer from gurus in Stackoverflow. Probably because another elementary question....:-(

https://stackoverflow.com/questions/49378854/wix-csharp-custom-action-not-fired
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/49378854/wix-csharp-custom-action-not-fired>

c# - Wix Csharp Custom Action not fired - Stack Overflow<https://stackoverflow.com/questions/49378854/wix-csharp-custom-action-not-fired>
stackoverflow.com
Wix Toolset 3.10 Visual Studio 2010 (With Wix Toolset Extension for Visual Studio 2010 https://marketplace.visualstudio.com/items?itemName=RobMensching ...





Still I don't have any errors from the msi file.

Is there any good sample of Visual Studio project with Csharp Custom Action...in GitHub or somewhere else? I have found several snippets by Google(like https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html), but still cannot find a whole working project file....
[https://blog-001.west.edge.storage-yahoo.jp/res/blog-aa-18/bumin_macintosh/folder/1491876/32/62857832/img_0]<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>

【WIX Toolset】カスタムアクション【Installer】 - 左の耳の為に<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>
blogs.yahoo.co.jp
WIX Toolsetというロハで使える便利なものがオープンソースで提供されている。 http://wixtoolset.org/ デフォルトで用意された ...




Thank you for your attention.
[https://blog-001.west.edge.storage-yahoo.jp/res/blog-aa-18/bumin_macintosh/folder/1491876/32/62857832/img_0]<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>

【WIX Toolset】カスタムアクション【Installer】 - 左の耳の為に<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>
[https://blog-001.west.edge.storage-yahoo.jp/res/blog-aa-18/bumin_macintosh/folder/1491876/32/62857832/img_0]<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>

【WIX Toolset】カスタムアクション【Installer】 - 左の耳の為に<https://blogs.yahoo.co.jp/bumin_macintosh/62857832.html>
blogs.yahoo.co.jp
WIX Toolsetというロハで使える便利なものがオープンソースで提供されている。 http://wixtoolset.org/ デフォルトで用意された ...



blogs.yahoo.co.jp
WIX Toolsetというロハで使える便利なものがオープンソースで提供されている。 http://wixtoolset.org/ デフォルトで用意された ...
WiX Toolset<http://wixtoolset.org/>
wixtoolset.org
About the WiX toolset. The WiX toolset lets developers create installers for Windows Installer, the Windows installation engine. The core of WiX is a set ...











____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/ WiX Support | WiX Experts and Resources from FireGiant<http://www.firegiant.com/>
www.firegiant.com
WiX Support | Installation, Development, Deployment | WiX Experts and Resources from FireGiant




____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/ WiX Support | WiX Experts and Resources from FireGiant<http://www.firegiant.com/>
www.firegiant.com
WiX Support | Installation, Development, Deployment | WiX Experts and Resources from FireGiant



____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list