Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all 1354 articles
Browse latest View live

New Post: .net 4.5 prerequisite is not working properly (Wix# 1.0.16.0, WixTools 3.9)

$
0
0
I found a solution in case of using Wix# v 1.0.17.0.

First you need to read and understand very short and clear MSDN article named How to: Determine Which .NET Framework Versions Are Installed.

So, if you need to know if .Net Framework 4.5 is installed you can use this way:
project.SetNetFxPrerequisite("NETFRAMEWORK45 >= '#378389'", "Please install .Net 4.5 first");
So, magic number #378389 is a number of release value from windows registry (see short table in article). Code will detect .Net framework 4.5 version and higher and you don't need to check registry manually.

Hope this helps.

New Post: .net 4.5 prerequisite is not working properly (Wix# 1.0.16.0, WixTools 3.9)

New Post: Issue using ManagedAction that references another assembly

$
0
0
The error in the MSI log is:
MSI (s) (14:98) [19:07:58:124]: Doing action: Action1_InstallDatabase
MSI (s) (14:98) [19:07:58:124]: Note: 1: 2205 2:  3: ActionText 
Action start 19:07:58: Action1_InstallDatabase.
MSI (s) (14:D8) [19:07:58:233]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIACD1.tmp, Entrypoint: InstallDatabase
MSI (s) (14:0C) [19:07:58:233]: Generating random cookie.
MSI (s) (14:0C) [19:07:58:233]: Created Custom Action Server with PID 5080 (0x13D8).
MSI (s) (14:A0) [19:07:58:249]: Running as a service.
MSI (s) (14:A0) [19:07:58:249]: Hello, I'm your 32bit Impersonated custom action server.
SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installer\MSIACD1.tmp-\
SFXCA: Failed to extract to temporary directory. Cabinet error code 1.
CustomAction Action1_InstallDatabase returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 19:07:58: Action1_InstallDatabase. Return value 3.
My project definition includes:
                new ManagedAction("InstallDatabase", Return.check, When.Before, Step.InstallFinalize, Condition.Create("&Database_components=3"))
                {
                    RefAssemblies = new[] { @"files\Sql\redacted.Services.LedDisplay.Sql.dll"}
                }

...


        [CustomAction]
        public static ActionResult InstallDatabase(Session session)
        {
            return WixCLRDialog.ShowAsMsiDialog(new InstallDatabase(session));
        }
The InstallDatabase class invokes a static method in another assembly (the one referenced above).

The actual message when I run the installer is
Could not load type 'redacted.Services.LedDisplay.Sql.SqlScription from assembly redacted.Services.LedDisplay.Sql.
How do I correctly invoke a static method in another assembly?

New Post: Issue using ManagedAction that references another assembly

$
0
0
I modified the <Wix# Samples>\Custom_UI\CustomCLRDialog sample to implement your scenario.
I haven't made the release yet so you will need to use Git to get the sample code.

New Post: Issue using ManagedAction that references another assembly

$
0
0
Thank you Oleg, I made the following change, and it worked perfectly.
new ManagedAction("InstallDatabase", Return.check, When.Before, Step.InstallFinalize, Condition.Create("&Database_components=3"))
{
    RefAssemblies = new[] { @"files\Sql\redacted.Services.LedDisplay.Sql.dll"}
}
to
 new ManagedAction("InstallDatabase", Return.check, When.Before, Step.InstallFinalize, Condition.Create("&Database_components=3"))
{
    RefAssemblies = new[] { typeof(redacted.Services.LedDisplay.Sql.SqlScripting).Assembly.Location }
}
Thank you for the prompt response, and a great product.

New Post: Issue using ManagedAction that references another assembly

$
0
0
I also noticed that if you create one ManagedAction that references an external assembly, others need to reference the same assembly, even if they do not use it, otherwise you get the error:
System.ApplicationException: ManagedAction assembly '%this%' is declared multipl
e times with the different (inconsistent) set of referenced assemblies. Ensure t
hat all declarations have the same referenced assemblies by either using identic
al declarations or by using Project.DefaultRefAssemblies.
   at WixSharp.ProjectValidator.Validate(Project project)
   at WixSharp.Compiler.GenerateWixProj(Project project)
   at WixSharp.Compiler.BuildWxs(Project project, String path, OutputType type)
   at WixSharp.Compiler.BuildWxs(Project project, OutputType type)
   at WixSharp.Compiler.Build(Project project, String path, OutputType type)
   at WixSharp.Compiler.Build(Project project, OutputType type)
   at REDACTED.Services.LedDisplay.Setup.Script.Main(String[] args) in e:\50126.Co
ndor.sign\REDACTED.Services.LedDisplay.Setup\setup.cs:line 126
When I tried:
new ManagedAction("ShowDatabaseDialog"),
new ManagedAction("InstallDatabase", Return.check, When.Before, Step.InstallFinalize, Condition.Create("&Database_components=3"))
{
    RefAssemblies = new[] { @"files\Sql\redacted.Services.LedDisplay.Sql.dll"}
}
This doesn't make sense to me, but adding the assembly to Project.DefaultRefAssemblies is a workaround.

New Post: Rollback post-install

$
0
0
Is it possible to rollback the installation from a custom action that is executed AFTER the InstallFinalize Step?

New Post: Rollback post-install

$
0
0
Is it possible to rollback the installation from a custom action that is executed AFTER the InstallFinalize Step?

New Post: Issue using ManagedAction that references another assembly

$
0
0
It is related to the Issue#16
Just to recapture...

MSI runtime treats custom action (and ref assemblies) on the per-action base. Meaning that for every action it will config an environment to be executed. In the case of managed actions it means that the assembly and it's dependency will be copied in to a temp dir where they will be executed from.

Consider the following scenario:
new ManagedAction("actionA", "myAsm.dll"),
new ManagedAction("actionB", "myAsm.dll"),
new ManagedAction("actionC", "myAsm.dll") { RefAssemblies = new [] { "externAsm.dll" } },
In order to avoid embedding tree separate assembly sets as myAsm.dll, myAsm.dll, and myAsm.dll+externAsm.dll you would rather embed a single set as myAsm.dll+externAsm.dll and link all three actions to it. That is why the solution is to declare your actions (that share the same implementation assembly) in the way that they share the same set of dependencies. This can be achieved as follows:
new MyManagedAction("actionA", "myAsm.dll", "externAsm.dll"),
new MyManagedAction("actionB", "myAsm.dll", "externAsm.dll"),
new MyManagedAction("actionC", "myAsm.dll", "externAsm.dll"),

//ornew MyManagedAction("actionA", "myAsm.dll"),
new MyManagedAction("actionB", "myAsm.dll"),
new MyManagedAction("actionC", "myAsm.dll"),
...
project.DefaultRefAssemblies.Add("externAsm.dll");

//ornew MyManagedAction("actionA"),
new MyManagedAction("actionB"),
new MyManagedAction("actionC"),
...
project.DefaultRefAssemblies.Add("myAsm.dll");
project.DefaultRefAssemblies.Add("externAsm.dll");
Your case is not different just your action assembly is "%this%".

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
Hello dear Wix# Community,

I tried to define 2 merge modules (WixSharp.Merge) in my component without making them part of a feature. (They are part of a UI component I'm using and have to be always installed).

But now I get the error:

Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

When I check the WXS I generate from the same project there is a Complete Feature (where are all my files of the setup are stored) but for some reason this is not found by the compiler.

I checked the Source Code of the Compiler class and there it searches for A XmlElement Feature with the name, is maybe the Completed feature added later?

How can I add the feature Complete? Or can I add a custom feature which is installed by default? Or do I have to use _WixSourceGenerated?

My second attept was to create a custom feature called Complete, but this only created a Completed.1. Also since I add two merge modules there is a bug that the Complete.1 feature is added twice in the xml which causes an error.

Thank you for Help and Greetings
Michi

Side Note:
I also noticed a bug setting the project.ControlPanelInfo.UrlInfoAbout causes the property to be written multiple times in the wxs, which causes a WiX error. Is this a known issue?

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
- Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found
"Complete" is an auto-generated feature generated in case you did not declared any. Though I tested and can confirm that indeed it is a challenge to implement the scenario like yours. I have created the ticket.

- I also noticed a bug setting the project.ControlPanelInfo.UrlInfoAbout causes the property to be written multiple times in the wxs, which causes a WiX error. Is this a known issue?

Can you please provide the test case for this. The ProductInfo sample doesn't exhibit the problem:
<?xmlversion="1.0"encoding="Windows-1252"?><Wixxmlns="http://schemas.microsoft.com/wix/2006/wi"><ProductId="6f330b47-2577-43ad-9095-1861ca25889c"Name="MyProduct"Language="1033"Codepage="Windows-1252"Version="1.0.0.0"UpgradeCode="6f330b47-2577-43ad-9095-1861ba25889b"Manufacturer="My Company"><PackageInstallerVersion="200"Compressed="yes"SummaryCodepage="Windows-1252"Languages="1033"/><MediaId="1"Cabinet="MyProduct.cab"EmbedCab="yes"/><DirectoryId="TARGETDIR"Name="SourceDir"><DirectoryId="ProgramFilesFolder"Name="ProgramFilesFolder"><DirectoryId="ProgramFilesFolder.My_Company"Name="My Company"><DirectoryId="INSTALLDIR"Name="My Product"><ComponentId="Component.readme.txt"Guid="6f330b47-2577-43ad-9095-18615e463af3"><FileId="readme.txt"Source="readme.txt"/></Component></Directory></Directory></Directory></Directory><PropertyId="ARPCOMMENTS"Value="Simple test msi"/><PropertyId="ARPCONTACT"Value="Product owner"/><PropertyId="ARPHELPLINK"Value="https://wixsharp.codeplex.com/support"/><PropertyId="ARPHELPTELEPHONE"Value="111-222-333-444"/><PropertyId="ARPPRODUCTICON"Value="app_icon.ico"/><PropertyId="ARPREADME"Value="https://wixsharp.codeplex.com/manual"/><PropertyId="ARPURLINFOABOUT"Value="https://wixsharp.codeplex.com/About"/><PropertyId="ARPURLUPDATEINFO"Value="https://wixsharp.codeplex.com/update"/><CustomActionId="Set_ARPINSTALLLOCATION"Property="ARPINSTALLLOCATION"Value="[INSTALLDIR]"/><CustomActionId="Set_ARPNOMODIFY"Property="ARPNOMODIFY"Value="True"/><UIRefId="WixUI_Minimal"/><FeatureId="Complete"Title="Complete"Absent="allow"Level="1"><ComponentRefId="Component.readme.txt"/></Feature><InstallExecuteSequence><CustomAction="Set_ARPINSTALLLOCATION"After="InstallInitialize"> (NOT Installed) </Custom><CustomAction="Set_ARPNOMODIFY"After="Set_ARPINSTALLLOCATION"> (NOT Installed) </Custom></InstallExecuteSequence><IconId="app_icon.ico"SourceFile="app_icon.ico"/></Product></Wix>

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
And yes, WixSourceGenerated would be the way to go until a proper solution is available.

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
Hi thank your for your quick response, sorry not for providing a sample for the second case:

I just checked and it seems the bug is caused because I call both BuildWxs and then BuildMsi. First I call BuildWxs (For generating a debug sample) and then Build the msi.

            var testWix = new Wix.Project("TestProj");
            testWix.ControlPanelInfo.Manufacturer = "MyManufacturer";
            testWix.ControlPanelInfo.UrlInfoAbout = "http://mywebpage.net";
            testWix.Language = "en-US";
            //testWix.Dirs = new Wix.Dir[] { installDir, startMenuDir };
            testWix.GUID = Guid.NewGuid(); // Dummy guid

            testWix.UpgradeCode = Guid.NewGuid(); // Dummy guid
            testWix.Version = new Version(1, 0, 0, 0);
            //Property[] arr = project.Properties;
            testWix.MajorUpgradeStrategy = Wix.MajorUpgradeStrategy.Default;
            testWix.MajorUpgradeStrategy.RemoveExistingProductAfter = Wix.Step.InstallInitialize;

            Wix.Compiler.WixLocation = @"C:\Libaries\WixSharp\Wix_bin\bin";
            //Wix.Compiler.WixSourceGenerated += OnCompiler_WixSourceGenerated;
            Wix.Compiler.BuildWxs(testWix, @"C:\Test\Testwix.wsx", Wix.Compiler.OutputType.MSI);
            Wix.Compiler.BuildMsi(testWix, @"C:\Test\Testmsi.msi");

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
A few points:
  • You should call BuildWxs or BuildMsi but not both. Remove BuildWxs and it will fix all problems. If you want to preserve Wxs the call
Wix.Compiler.PreserveTempFiles = true;
  • You don't have to use 'dummy guids' they will be generated for you automatically.

New Post: error CS0246: The type or namespace name 'WixSharp' could not be found

$
0
0
I execute the Wix# script like cscs Script.cs (Script.cs is C# file)
from command line and get the error:
error CS0246: The type or namespace name 'WixSharp' could not be found (are you missing a using directive or an assembly reference?)

WixSharp binary is installed at the c:\lib\WixSharp and environment variables are set
WIXSHARP_DIR=C:\lib\WixSharp
WIXSHARP_WIXDIR=C:\lib\WixSharp\Wix_bin\bin

I try both ordinary Windows command prompt and Developer Command Prompt for VS2013. Same error.
WixSharp NuGet package is installed and assembly is referenced in the project.

Any suggestions what is wrong with my WixSharp setup?

New Post: How to create a shortcut to startup menu?

$
0
0
How to add a program shortcut to user's startup menu?
Any code example please?

New Post: error CS0246: The type or namespace name 'WixSharp' could not be found

$
0
0
The solution will be in the script.cs file. Most likely the script is missing the reference to the wixsharp.dll. If you are executing the script from VS then the assembly is referenced explicitly in the VS project file. But you are executing it with CS-Script so you need to let the script engine know where to probe for wixsharp.dll. There various ways of doing this. Add to your script (above usings):
//css_ref %WIXSHARP_DIR%\wixsharp.dll;

or 

//css_dir %WIXSHARP_DIR%; using WixSharp; 
Some additional reading:
http://www.csscript.net/help/using_.net_assemblies.html
http://www.csscript.net/help/Adding_Searchdirs.html

New Post: How to create a shortcut to startup menu?

$
0
0
Almost 95% of Wix# code base are the code samples. :)
Download the package. All samples are included. Have a look at "AllInOne" sample.

New Post: MergeModule Additional information: Merge Module XXX does not belong to any feature and "Complete" feature is not found

$
0
0
The Release v1.0.18.0 now handles the double WXS compilation.

New Post: error CS0246: The type or namespace name 'WixSharp' could not be found

$
0
0
//css_ref %WIXSHARP_DIR%\wixsharp.dll;
This works fine!
Thank you.
Viewing all 1354 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>