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

Matsumoto Chihiro illuminate33 at hotmail.com
Mon Mar 26 19:13:08 PDT 2018


Ronny

Let me get straight to the point, your proposal using expression syntax "$(var.CustomAction.TargetDir)" go well, Browser button opening the File Explorer.

>So what I do is that I have everything in the same solution in VS.

Thank you very much for your effort. I'm sorry for taking your precious time.
Detail will be posted to the original stackoverflow thread later.

>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.

I suppose your wise proposal is just what I wanted.

>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.

I appreciate your generous share of your treasure vault.



________________________________
²î³öÈË: wix-users <wix-users-bounces at lists.wixtoolset.org> ¤¬ Ronny Eriksson via wix-users <wix-users at lists.wixtoolset.org> ¤Î´úÀí¤ÇËÍÐÅ
ËÍÐÅÈÕ•r: 2018Äê3ÔÂ27ÈÕ 1:22
ÍðÏÈ: WiX Toolset Users Mailing List
CC: Ronny Eriksson
¼þÃû: Re: [wix-users] CSharp Wix Custom Action not fired.

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<http://www.optimitysoftware.com>
[http://optimitysoftware.com/wp-content/uploads/2016/08/badge_bg_orng.jpg]<http://www.optimitysoftware.com/>

Optimity Supply Chain Planning Software: Profit-based ...<http://www.optimitysoftware.com/>
www.optimitysoftware.com
Optimized supply chain planning in a single application, with an overall profit focus. Manage the complexity. Flexible and customizable.



Sign up to the Optimity Newsletter

IMPORTANT ¨C 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> ¤Î´úÀí¤ÇËÍÐÅ
ËÍÐÅÈÕ•r: 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<http://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<http://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 Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list