Windows

Wixでインストーラー作成


SharpDevelop2.2とWixを使用するとMSIパッケージが作成出来ます。
今回はWindowsサービス版のexe及び関連ファイルをパッケージにまとめます。

pict01.JPG
んで、↓がWindowsサービス用のwxsファイルになります。

[ Setup.wxs ]
--------------------------
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
    <Product Id="75AD61FC-0FCA-4AB2-AD89-02FAC9AE6659" Name="IntraMaster" Language="1041" Version="1.0.0.0" UpgradeCode="9BC2C5A1-C152-43B5-8B90-1F342707E638" Manufacturer="Giga-works.com" Codepage="932">
        <Package Id="75AD61FC-0FCA-4AB2-AD89-02FAC9AE6659" Keywords="IntraMaster" Description="InstraMaster Installer" Comments="InstraMaster Installer" InstallerVersion="200" Compressed="yes" Languages="1041" />

        <Media Id="1" Cabinet="Release.cab" EmbedCab="yes" />

        <Condition Message='This setup requires the .NET Framework 2.0 or higher.'>
          <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]>
        </Condition>
       
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" SourceName="PFILE" LongSource="Program Files">
                <Directory Id="INSTALLLOCATION" SourceName="IMS" Name="IMS" LongName="IntraMaster">
                    <Component Id="MainExe" Guid="75AD61FC-0FCA-4AB2-AD89-02FAC9AE6659">
                        <File Id="IntraMaster2S.exe" LongName="IntraMaster2S.exe" Name="IMS.exe" KeyPath="yes" DiskId="1" Source="Release\IntraMaster2S.exe" />
                        <File Id="IntraMaster2S.exe.config" LongName="IntraMaster2S.exe.config" Name="IMS.cfg" DiskId="1" Source="Release\IntraMaster2S.exe.config" />
                        <File Id="Interop.EventSystemLib.dll" LongName="Interop.EventSystemLib.dll" Name="EventSys.dll" DiskId="1" Source="Release\Interop.EventSystemLib.dll" />
                        <File Id="Interop.SensEvents.dll" LongName="Interop.SensEvents.dll" Name="SENS.dll" DiskId="1" Source="Release\Interop.SensEvents.dll" />
                    </Component>
                </Directory>
            </Directory>
        </Directory>
       
        <Feature Id="MyFeature" Title="Required Files" Level="1">
            <ComponentRef Id="MainExe" />
        </Feature>

        <InstallExecuteSequence>
            <Custom Action="InstallUtil" After="InstallFinalize">
                <![CDATA[NOT Installed]]>
            </Custom>
            <Custom Action="UnInstallUtil" Before="RemoveFiles">
                <![CDATA[Installed]]>
            </Custom>
        </InstallExecuteSequence>
       
        <CustomAction Id="InstallUtil"
            Win64="no"
            Directory="INSTALLLOCATION"
            ExeCommand='"[WindowsFolder]\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" /LogToConsole=false IntraMaster2S.exe'
            Return="check"
            />

        <CustomAction Id="UnInstallUtil"
          Win64="no"
          Directory="INSTALLLOCATION"
          ExeCommand='"[WindowsFolder]\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" /LogToConsole=false /u IntraMaster2S.exe'
          Return="check"
          />
    </Product>
</Wix>
[EOF]
--------------------------

[ 参考URL ]
http://cml.s10.xrea.com/ej/WiX/xsd/wix_xsd_ja.htm
http://cml.s10.xrea.com/ej/WiX/xsd/wix_xsd_customaction.htm
http://nishik-t.com/weblog/2007/11/wix.html
このページの先頭へ