MSI installer?

Main development forum.

MSI installer?

Postby kimmov » Fri Mar 06, 2009 2:52 pm

Is somebody interested in working with MSI installer for WinMerge (2.13.x/2.14.x)?

The feature request item is #1204308 MSI installer.

MSI installers have several advantages over InnoSetup. MSI installers e.g. allow deploying WinMerge by administrators to large number of computers at once. Which is of course important in corporate environments.

Earlier (when I last time looked at this) the tools were a bit lacking for creating MSI installers with Wix. Now the WixEdit has improved a lot and there is integration in SharpDevelop too.

I understand it might sound frightening to start creating an installer from a scratch. And it is. But it really isn't hard if you know some basics about installing and XML. And the first version does not need to be perfect and have feature-parity with existing installer. Just copying executable and dlls to the program files folder is good enough for a first version.

The important thing is to have creation of MSI installer started and have some progress with it. I will help as much as I can of course.
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: MSI installer?

Postby gerundt » Fri Mar 06, 2009 7:23 pm

I played in the past with the Wix files from WinMergeX, but with a plain editor this was really hard to understand. Maybe I can give WixEdit a try. But I don't know, when I have time for this...
gerundt
Site Admin
 
Posts: 193
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: MSI installer?

Postby gerundt » Mon Mar 16, 2009 9:31 pm

Uff, WiX is really hard to learn! I needed hours for this XML file and it only copy the EXE and DLL files. :(

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="DEAFBEEF-DEAD-DEAD-DEAD-DEADBEEF0001"
    Codepage="1252"
    Language="1033"
    Manufacturer="Thingamahoochie Software"
    Name="WinMerge"
    UpgradeCode="DEAFBEEF-DEAD-DEAD-DEAD-DEADBEEF0009"
    Version="0.0.1">
   
    <Package Id="*"
      Comments="WinMerge"
      Compressed="yes"
      Description="WinMerge Installer"
      InstallerVersion="200"
      Keywords="Installer"
      Languages="1033"
      Manufacturer="Thingamahoochie Software"
      SummaryCodepage="1252" />
   
    <Media Id="1"
      Cabinet="winmerge.cab"
      EmbedCab="yes" />
   
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="WinMerge">
          <Component Id="Core"
            Guid="DEAFBEEF-DEAD-DEAD-DEAD-DEADBEEF0002">
           
            <File Id="WinMergeUEXE"
              Name="WinMergeU.exe"
              Source="..\..\Build\MergeUnicodeRelease\WinMergeU.exe"
              Vital="yes" />
           
            <!--TODO: Windows 32bit -->
            <File Id="ShellExtensionUDLL"
              Name="ShellExtensionU.dll"
              Source="..\..\Build\MergeUnicodeRelease\ShellExtensionU.dll"
              Vital="yes" />
           
            <!--TODO: Windows 64bit -->
            <File Id="ShellExtensionX64DLL"
              Name="ShellExtensionX64.dll"
              Source="..\..\Build\ShellExtensionX64\ShellExtensionX64.dll"
              Vital="yes" />
           
            <File Id="libexpatDLL"
              Name="libexpat.dll"
              Source="..\..\Build\expat\libexpat.dll"
              Vital="yes" />
           
            <File Id="pcreDLL"
              Name="pcre.dll"
              Source="..\..\Build\pcre\pcre.dll"
              Vital="yes" />
           
            <File Id="MergeLangDLL"
              Name="MergeLang.dll"
              Source="..\..\Build\MergeUnicodeRelease\MergeLang.dll"
              Vital="yes" />
           
            <File Id="hekseditUDLL"
              Name="hekseditU.dll"
              Source="..\..\Build\heksedit\hekseditU.dll"
              Vital="yes" />
           
          </Component>
        </Directory>
      </Directory>
    </Directory>
   
    <Feature Id="Complete" Level="1">
      <ComponentRef Id="Core" />
    </Feature>
   
    <!-- TODO: Works this really? -->
    <Condition Message="WinMerge requires Windows 2000/XP/2003/Vista/2008 or later to install.">
      <![CDATA[( VersionNT <= 500 ) OR ( Version9x <> 0 )]]>
    </Condition>
   
    <UI />
   
  </Product>
</Wix>
gerundt
Site Admin
 
Posts: 193
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: MSI installer?

Postby kimmov » Mon Mar 16, 2009 9:50 pm

It is hard to learn if you start writing XML in the editor... I know I've got frustrated few times myself with it. And they say Wix is the easy way to create MSI installers... :geek:

One reason I started this whole topic was I tried creating Wix file with SharpDevelop and it looked like it really created working installer with the wizard! As far as I know, TortoiseSVN developers use(d) SharpDevelop for Wix too.

I don't expect anybody can create fully working MSI installer in short time. It will took lots of time and testing. It just would be nice we get some starting point. And looks like we have it, right? Your script copies files, that is all I wanted to get it started.

Please submit that as a patch and then we can add it to the sources and start improving it and thinking about all the issues there are to solve...
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: MSI installer?

Postby gerundt » Mon Mar 16, 2009 10:17 pm

I used WixEdit, but you must still know the XML attributes... :?

This new version copied the "docs" files too and use now a own component for each file. In this case we can use auto-generated GUIDs for components.

I will submit it as patch tomorrow. Now it is time for the bed! :mrgreen:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="DEAFBEEF-DEAD-DEAD-DEAD-DEADBEEF0001"
    Codepage="1252"
    Language="1033"
    Manufacturer="Thingamahoochie Software"
    Name="WinMerge"
    UpgradeCode="DEAFBEEF-DEAD-DEAD-DEAD-DEADBEEF0009"
    Version="0.0.1">
   
    <Package Id="*"
      Comments="WinMerge"
      Compressed="yes"
      Description="WinMerge Installer"
      InstallerVersion="200"
      Keywords="Installer"
      Languages="1033"
      Manufacturer="Thingamahoochie Software"
      SummaryCodepage="1252" />
   
    <Media Id="1"
      Cabinet="winmerge.cab"
      EmbedCab="yes" />
   
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="WinMerge">
          <!-- Core -->
          <Component Id="WinMergeU" Guid="*">
            <File Id="WinMergeUEXE"
              Name="WinMergeU.exe"
              Source="..\..\Build\MergeUnicodeRelease\WinMergeU.exe"
              Vital="yes" />
          </Component>
         
          <!--TODO: Windows 32bit -->
          <Component Id="ShellExtension" Guid="*">
            <File Id="ShellExtensionUDLL"
              Name="ShellExtensionU.dll"
              Source="..\..\Build\MergeUnicodeRelease\ShellExtensionU.dll"
              Vital="yes" />
          </Component>
         
          <!--TODO: Windows 64bit -->
          <Component Id="ShellExtensionX64" Guid="*">
            <File Id="ShellExtensionX64DLL"
              Name="ShellExtensionX64.dll"
              Source="..\..\Build\ShellExtensionX64\ShellExtensionX64.dll"
              Vital="yes" />
          </Component>
         
          <Component Id="libexpat" Guid="*">
            <File Id="libexpatDLL"
              Name="libexpat.dll"
              Source="..\..\Build\expat\libexpat.dll"
              Vital="yes" />
          </Component>
         
          <Component Id="pcre" Guid="*">
            <File Id="pcreDLL"
              Name="pcre.dll"
              Source="..\..\Build\pcre\pcre.dll"
              Vital="yes" />
          </Component>
         
          <Component Id="MergeLang" Guid="*">
            <File Id="MergeLangDLL"
              Name="MergeLang.dll"
              Source="..\..\Build\MergeUnicodeRelease\MergeLang.dll"
              Vital="yes" />
          </Component>
         
          <Component Id="heksedit" Guid="*">
            <File Id="hekseditUDLL"
              Name="hekseditU.dll"
              Source="..\..\Build\heksedit\hekseditU.dll"
              Vital="yes" />
          </Component>
         
          <!-- Documentation -->
          <Component Id="Files" Guid="*">
            <File Id="FilesTXT"
              Name="Files.txt"
              Source="..\..\Docs\Users\Files.txt"
              Vital="no" />
          </Component>
         
          <Component Id="Contributors" Guid="*">
            <File Id="ContributorsTXT"
              Name="Contributors.txt"
              Source="..\..\Docs\Users\Contributors.txt"
              Vital="no" />
          </Component>
         
          <Directory Id="DOCSDIR" Name="Docs">
            <Component Id="ReadMe" Guid="*">
              <File Id="ReadMeTXT"
                Name="ReadMe.txt"
                Source="..\..\Docs\Users\ReadMe.txt"
                Vital="no" />
            </Component>
           
            <Component Id="ReleaseNotes" Guid="*">
              <File Id="ReleaseNotesHTML"
                Name="ReleaseNotes.html"
                Source="..\..\Docs\Users\ReleaseNotes.html"
                Vital="no" />
            </Component>
           
            <Component Id="ChangeLog" Guid="*">
              <File Id="ChangeLogTXT"
                Name="ChangeLog.txt"
                Source="..\..\Docs\Users\ChangeLog.txt"
                Vital="no" />
            </Component>
           
            <Component Id="WinMergeHelp" Guid="*">
              <File Id="WinMergeCHM"
                Name="WinMerge.chm"
                Source="..\..\Build\Manual\htmlhelp\WinMerge.chm"
                Vital="no" />
            </Component>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
   
    <Feature Id="Complete" Level="1">
      <Feature Id="Core" Level="1">
        <ComponentRef Id="WinMergeU" />
        <ComponentRef Id="ShellExtension" />
        <ComponentRef Id="ShellExtensionX64" />
        <ComponentRef Id="libexpat" />
        <ComponentRef Id="pcre" />
        <ComponentRef Id="MergeLang" />
        <ComponentRef Id="heksedit" />
      </Feature>
      <Feature Id="Documentation" Level="1">
        <ComponentRef Id="Files" />
        <ComponentRef Id="Contributors" />
        <ComponentRef Id="ReadMe" />
        <ComponentRef Id="ReleaseNotes" />
        <ComponentRef Id="ChangeLog" />
        <ComponentRef Id="WinMergeHelp" />
      </Feature>
    </Feature>
   
    <!-- TODO: Works this really? -->
    <Condition Message="WinMerge requires Windows 2000/XP/2003/Vista/2008 or later to install.">
      <![CDATA[( VersionNT <= 500 ) OR ( Version9x <> 0 )]]>
    </Condition>
   
    <UI />
   
  </Product>
</Wix>
gerundt
Site Admin
 
Posts: 193
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: MSI installer?

Postby kimmov » Thu Mar 19, 2009 8:30 pm

Tim submitted first version as patch item #2690509 Installer: First MSI setup. And that first version is already committed to SVN trunk and is in 2.13.5 experimental release source package.
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: MSI installer?

Postby gerundt » Sat Apr 18, 2009 12:49 pm

I have a question about ShellExtensionX64. Is this a real 64bit DLL or a 32bit DLL which is optimized for a 64bit Windows?

The problem is, if I mark this component as "Win64=yes" I get the following errors:
Light.exe wrote:..\WinMerge.wxs(67): error LGHT0204: ICE80: This package contains 64 bit component 'ShellExtensionX64' but the Template Summary Property does not contain Intel64 or x64.
..\WinMerge.wxs(67): error LGHT0204: ICE80: This 64BitComponent ShellExtensionX64 uses 32BitDirectory INSTALLDIR


Where install the current InnoSetup the WinMerge files on a 64bit machine? "Program Files" or "Program Files (x86)"? Would it be correct, to install (with a 64bit setup) all WinMerge files in "Program Files", even when only 1 file is a real 64but file? Or have we 64bit WinMerge files?
gerundt
Site Admin
 
Posts: 193
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: MSI installer?

Postby gerundt » Sat Apr 18, 2009 1:45 pm

I read at WiX tricks and best practices the following:

3. For our products, the simplest approach seems to be to always do major upgrades, so our ProductCode is set as * (auto-generate for each build) and our UpgradeCode is fixed to a unique Guid and will never change (unless we don't want to upgrade existing product)


I saw that the TortoiseSVN Setup use also a auto-generated product id and a fixed upgrade code. So, should we use this way too?
gerundt
Site Admin
 
Posts: 193
Joined: Wed Sep 24, 2008 8:47 am
Location: Germany

Re: MSI installer?

Postby kimmov » Sat Apr 18, 2009 2:15 pm

gerundt wrote:I have a question about ShellExtensionX64. Is this a real 64bit DLL or a 32bit DLL which is optimized for a 64bit Windows?

It is real 64-bit DLL. DLL must be always same bitness than the process loading it. And since 64-bit Windows runs 64-bit Explorer, DLL loaded by 64-bit Explorer must be 64-bit.

gerundt wrote:The problem is, if I mark this component as "Win64=yes" I get the following errors:
Light.exe wrote:..\WinMerge.wxs(67): error LGHT0204: ICE80: This package contains 64 bit component 'ShellExtensionX64' but the Template Summary Property does not contain Intel64 or x64.
..\WinMerge.wxs(67): error LGHT0204: ICE80: This 64BitComponent ShellExtensionX64 uses 32BitDirectory INSTALLDIR

Where install the current InnoSetup the WinMerge files on a 64bit machine? "Program Files" or "Program Files (x86)"?

I don't have 64-bit Windows installed right now. So I can't check to be sure, but if I remember correctly:
  • Program Files: 64-bit shell extension
    Program Files (x86): all other files
The reason is that files in Program Files (x86) are run through wow32 which fakes them as 64-bit programs. So you cannot run 32-bit program from Program Files-folder if I remember correctly.

gerundt wrote:Would it be correct, to install (with a 64bit setup) all WinMerge files in "Program Files", even when only 1 file is a real 64but file? Or have we 64bit WinMerge files?

No we can't do that.

We don't have 64-bit executables (and other DLL:s) for WinMerge. Since the advantage of them is small - 32-bit binaries work perfectly well in 64-bit Windows. Takashi did some work to fix issues in 64-bit builds but I'm not sure about the current status.
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: MSI installer?

Postby kimmov » Sat Apr 18, 2009 2:17 pm

gerundt wrote:I saw that the TortoiseSVN Setup use also a auto-generated product id and a fixed upgrade code. So, should we use this way too?

If that is the recommended way to do this, then why not..
kimmov
 
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Next

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests