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

New Post: Project Won't Build if Using SilentBootstrapperApplication

$
0
0
Wix# SilentBootstrapperApplication is built using WiX ManagedBootstrapperApplicationHost bootstrapper app which is a WiX managed module. Thus WiX introduces .NET package dependency for both ManagedBootstrapperApplicationHost and WixStandardBootstrapperApplication application types expressed via WixMbaPrereqPackageId WiX variable referencing the specific .NET package to be installed.

The easiest way to handle this problem is to indicate what .NET you want to be installed. The following change will make light happy:
var bootstrapper =
            new Bundle("MyProject",
                new PackageGroupRef("NetFx40Web"),
                new MsiPackage(msiFile))
                ...

New Post: RemoveExistingProductAfter values

$
0
0
> Is there any chance the installer to remove the old installation after installing the new installation at a major upgrade without removing the new installation
I see your point but I am not sure MSI/WiX supports that.

You may want to have a look at Project.MajorUpgrade (instead of MajorUpgradeStrategy). It is a later addition to the WiX elements and it was introduced to simplify and reflect more modern upgrade scenarios. Possibly it will have something useful for your case. You will find the corresponding sample in Wix#/Samples/MajorUpgrade/MajorUpgrade/sample.cs.

New Post: How to install fonts?

$
0
0
I don't think installing the font requires you to pot it into the Fonts folder. Quick googling indicated that it is only a matter indicating that the file being installed is a font file. In Wix# it is achieved via additions attribute definition:
new File(@"C:\Windows\Fonts\Roboto-Bold.ttf") { AttributesDefinition="TrueType=yes"},
Please let me know if this simple change addresses the issue and I will update the samples to reflect "Font installation" scenario.

New Post: How to install fonts?

$
0
0
Thanks for the reply Oleg.

I've now tried your suggestion (file by itself with an attributesdefinition) as well as keeping the %FontsFolder% directory with the aforementioned file with attribute, neither of which have successfully installed a font.

In the wix source file that was generated by wix#, it translated to the following (just the file by itself with attributesdefinition):
<Component Id="Component.Roboto-Bold.ttf" Guid="6f330b47-2577-43ad-9095-1861186d24b2">
              <File Id="Roboto-Bold.ttf" Source="..\..\..\..\..\..\..\..\..\Windows\Fonts\Roboto-Bold.ttf" TrueType="yes" />
            </Component>
My other setup project where I successfully install a font file ( straight wix, not wix#), has the following:
<DirectoryRef Id="FontsFolder">
      <Component Id="InstallFonts" Guid="{1C3139F1-C745-45D9-820D-68ABD9EBD48F}">
        <File Id="RobotoLight.TTF" Source="C:\Windows\Fonts\Roboto-Light.ttf" TrueType="yes" />
      </Component>
    </DirectoryRef>
Are the extra "........\" that show up in the source location for the font generated by wix# the culprit?

Thanks
David

New Post: How to install fonts?

$
0
0
Oleg,

I hooked onto the WixSourceGenerated event and modified the XDocument file to correct the font source to Source="C:\Windows\Fonts\Roboto-Light.ttf" from Source="..................\Windows\Fonts\Roboto-Light.ttf". This corrected the issue, the font installed correctly once this was done. Perhaps a bug?

New Post: How to install fonts?

$
0
0
No, the path cannot be the cause of the problem. If it was then candle would complain that the file could not be found.

I actually managed to test it and found that the solution works. I even updated the code with a specialized class FontFile and the corresponding sample (you can get it from here: "https://wixsharp.codeplex.com/SourceControl/latest#src/WixSharp.Samples/Wix# Samples/Install Font/setup.cs"). The whole working sample is as follows:
staticpublicvoid Main()
{
    var project =
        new Project("MyProduct",
            new Dir(@"%ProgramFiles%\My Company\My Product",
                new File("readme.txt")),
            new Dir("%Fonts%", 
                new FontFile("FreeSansBold.ttf")));
        
                //The same can be achieved with File and custom attributes//new File("FreeSansBold.ttf") { AttributesDefinition="TrueType=yes"}));

    project.UI = WUI.WixUI_ProgressOnly;
    project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
    project.PreserveTempFiles = true;

    project.BuildMsi();
}
Note that you don't have to use FontFile and you can use extra attributes with the File class.

The sample installs the test font properly:
Image

New Post: How to install fonts?

$
0
0
> I hooked onto the WixSourceGenerated event and modified the XDocument file to correct the font source to Source="C:\Windows\Fonts\Roboto-Light.ttf" from Source="..................\Windows\Fonts\Roboto-Light.ttf". This corrected the issue, the font installed correctly once this was done. Perhaps a bug?
I only noticed this post.

You don't have to resort to WixSourceGenerated when relative path is a challenge. You can place the full path directly to the file constructor. I know it seems that it didn't work in your case but when I modified the code sample to include one of the system fonts like this:
new Dir("%Fonts%", 
    new File(@"C:\Windows\Fonts\yuminl.ttf")
It actually preserved the path as expected:
<ComponentId="Component.yuminl.ttf"Guid="6f330b47-2577-43ad-9095-18616b080af8"><FileId="yuminl.ttf"Source="C:\Windows\Fonts\yuminl.ttf"/></Component>
Thus I am not sure about the cause of that conversion to the relative path in your sample.

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
Hi ,

I am trying to create setup using wixsharp in my website its works fine when i am running it in visual studio. but when i deploy it on IIS it create the all necessary file for the setup but at the end doesn't create the setup. I am using WixSharp v1.0.27.0 .

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
Sorry I am a bit confused. Can you elaborate?

> I am trying to create setup using wixsharp in my website its works fine when i am running it in visual studio.
What exactly works fine? Do you mean 'wixsharp works fine' or 'website works fine'?

> but when i deploy it on IIS it create the all necessary file for the setup but at the end doesn't create the setup.
If you managed to deploy the website it means that you have built the msi setup file and executed it. Is it correct? If it is then what does it mean "doesn't create the setup."

Is it is not correct and "deploy it" means that VS copied the files into IIS app directories then you also need to run the Wix# compiler to build the msi? You can do this by either using the WixSharp Visual Studio project template or manually.

The all aspects of Wix# Visual Studio integration are reflected in the Wiki documentation. And for the code sample you will need to have a look at IIS_ASP_NETApp sample.

New Post: How to install fonts?

$
0
0
I ran your example on wix# 1.0.28 binary, with only a modification of what font file it will use and I used the attributesdefinition version rather than FontFile (since its not in my version):
static public void Main()
{
 var project =
                new Project("MyProduct",
                    new Dir(@"%ProgramFiles%\My Company\My Product",
                        new File("readme.txt")),
                    new Dir("%Fonts%",
                        new File(@"C:\Windows\Fonts\Roboto-Light.ttf") {AttributesDefinition = "TrueType=yes"}));

            project.UI = WUI.WixUI_ProgressOnly;
            project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
            project.PreserveTempFiles = true;


            project.WixSourceGenerated += ProjectOnWixSourceGenerated;
            var path = project.BuildMsi();
}
The following was generated... still has the relative directory all screwy.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="6f330b47-2577-43ad-9095-1861ca25889c" Name="MyProduct" Language="1033" Codepage="Windows-1252" Version="1.0.0.0" UpgradeCode="6f330b47-2577-43ad-9095-1861ba25889b" Manufacturer="ddavi">
    <Package InstallerVersion="200" Compressed="yes" SummaryCodepage="Windows-1252" Languages="1033" />
    <Media Id="1" Cabinet="MyProduct.cab" EmbedCab="yes" />
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder" Name="ProgramFilesFolder">
        <Directory Id="ProgramFilesFolder.My_Company" Name="My Company">
          <Directory Id="INSTALLDIR" Name="My Product">
            <Component Id="Component.readme.txt" Guid="6f330b47-2577-43ad-9095-18615e463af3">
              <File Id="readme.txt" Source="readme.txt" />
            </Component>
          </Directory>
        </Directory>
      </Directory>
      <Directory Id="FontsFolder" Name="FontsFolder">
        <Component Id="Component.Roboto_Light.ttf" Guid="6f330b47-2577-43ad-9095-18617fbcbe58">
          <File Id="Roboto_Light.ttf" Source="..\..\..\..\..\..\..\..\..\Windows\Fonts\Roboto-Light.ttf" TrueType="yes" />
        </Component>
      </Directory>
    </Directory>
    <Feature Id="Complete" Title="Complete" Absent="allow" Level="1">
      <ComponentRef Id="Component.readme.txt" />
      <ComponentRef Id="Component.Roboto_Light.ttf" />
    </Feature>
  </Product>
</Wix>
I am not sure what is causing the differences between you and I but I immensely appreciate your help. I am able to overcome this challenge with modifying the wix file as I did before, but there must be a bigger problem somewhere that is causing the need for me to do that in the first place.

But of course, in actual deployment I wouldn't want to rely on the system fonts folder to provide the font (since not every developer may have the same fonts installed), so I will include it with the setup/builder project and see if that functions. I'll let you know.. thanks.

New Post: How to install fonts?

$
0
0
Oleg,

I just tried it with my font added as file to my project (so it shows up in my debug folder), the wix source generated made sense for the path and it installed correctly to my virtual box. I am still not sure why the fonts folder path does not work correctly, but that wouldn't be a very smart way to go about it in the first place... it was just the easiest to do to demo the wix# package.

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
Hi,

  • Wixsharp Dll works fine and create the setup file. In my scenario user will select some files through my website or upload them then those files will be packaged into the setup for installation.

  • When i deploy the website into IIS and select some files through my website which will be packaged into setup through wixsharp. the whole process works fine create these files:
    setup.wxs ,
    Pikard.wixobj ,
    Pikard.wixpdb
    necessary for the setup.but in the end don't create the setup file setup.msi.

Note:- I am not intalling website with wixsharp setup. But i am creating setup using wixsharp dll through my website.

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
OK, I see.
Then I suggest you have a look at the output that is generated by the Project.BuildMsi() call. It will have the description of the problem you have. It can be a few things. May be some files not found or WiX tools not detected. Without the output log it's almost impossible to troubleshoot it.

New Post: Project Won't Build if Using SilentBootstrapperApplication

$
0
0
Ah I see - I misunderstood and thought that since I wasn't bothered about any pre requisites I did not need that line. I've tried it out and it works as I expect, plus it's no bad thing to have a pre req check since we do technically require .Net 4 on the target machine.

Many thanks Oleg - keep up the good work!

New Post: How to install fonts?

$
0
0
OK I think I know the cause for the discrepancy in the wxs code generation on your and my machines. My build script is located on a non-system partition thus the paths cannot be converted in relative and the compiler falls back to the absolute paths. However in your case most likely you are running your script from the system partition (c:\ drive) and the font directory from the same partition is resolved into relative path as expected. This default behavior can be overwritten with Compiler.EmitRelativePaths = false;.

This is what I did for further testing. I just created the project from VS WixSharp template and only added a single line of code without even modifying the project items:
var project =
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
            new File("readme.txt")),
         //next is the new test codenew Dir("%Fonts%", new FontFile(@"C:\Windows\Fonts\arial.ttf")));
This code emits (as it should) relative paths"
<ComponentId="Component.arial.ttf"Guid="6fe30b47-2577-43ad-9095-186133ca6a46"><FileId="arial.ttf"Source="..\..\..\..\..\..\..\Windows\Fonts\arial.ttf"TrueType="yes"/></Component>
Though in my case this relative path is a correct one. Thus the following simple check from the script:
Console.WriteLine("Path test: " + System.IO.Path.GetFullPath(@"..\..\..\..\..\..\..\Windows\Fonts\arial.ttf"));
project.BuildMsi();
Yields the expected output:
------ Build started: Project: WixSharp Setup12, Configuration: Debug Any CPU ------
  WixSharp Setup12 -> C:\Users\<user>\Documents\Visual Studio 2015\Projects\WixSharp Setup12\WixSharp Setup12\bin\Debug\WixSharp Setup.exe
  Building MSI
  Path test: C:\Windows\Fonts\arial.ttf
All this means that there is no obvious reason for the emitted relative path on your PC to be wrong so let's verify that it is indeed wrong. Can you please put the same path test in your code and verify the output?

I agree, the production build will have to source the font file not from the Fonts folder but from the source control thus you are not affected by this problem. But I really want to see what causes (if indeed it does) the error in your environment as it may indicate the actual problem with the compiler.

Thank you

New Post: How to install fonts?

$
0
0
Hello Oleg,

The result of the path test is the following:
Path test: C:\Users\ddavis\Windows\Fonts\arial.ttf

I'm running VS2015 on Windows 10, FYI.

New Post: Placing an executable and an MSI in a bundle, in a bootstrapper

$
0
0
I would like to place an Adobe Installer in my bootstrapper. Are there examples how to do that?

I want the bootstrapper to bundle an MSI file and the Adobe Installer and of course install the bundle.

Thanks!

New Post: Placing an executable and an MSI in a bundle, in a bootstrapper

$
0
0
You will need to use ExePackage class similarly to the MsiPackage class in the Bootstrapper samples.
Though if your Adobe setup is a "exe+msi" package then you will need to embed the msi file into ExePackage.Payload.

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
I have done some changes in IIS Manager in some scenarios it work and in some it don't. i have listed the setting which i have done in IIS Manager .
If in IIS Manager DefaultAppPool Identity is set to LocalSystem then wixsharp code create the setup.msi file successfully without any error. But if DefaultAppPool Identity is set to ApplicationPoolIdentity the wixsharp code create these files:
setup.wxs ,
Pikard.wixobj ,
Pikard.wixpdb
necessary for the setup.but don't create the setup file setup.msi.

Below is link to files which are created when IIS Manager DefaultAppPool Identity is set to ApplicationPoolIdentity.
Setup.wxs
Setup.wixobj

New Post: Creating WixSharp Setup in asp.net website.

$
0
0
The fact that the same Wix# build script builds msi under one hosting conditions but not others means most likely your Wix# code is OK. Meaning that it is your hosting is model affects the outcome.

My previous email still stands. What is the Wix# compiler output? The files you shared are irrelevant at this stage. The clue will be in the error reported by Wix# compiler.
Viewing all 1354 articles
Browse latest View live


Latest Images

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