2

InstallShield テクノロジを使用して、クライアント用のインストーラを用意しました。インストーラーは正常に動作しますが、クライアントはこのインストーラーを msi テクノロジで要求しています。WiX を使用してラッパーを作成することにしました。Msi インストーラーはいくつかのことを行う必要があります。

  1. IS インストーラーを一時ディレクトリに抽出します。
  2. InstallShield setup.exe を実行します。
  3. IS 終了後に一時ディレクトリを削除します。

以前に WiX テクノロジでインストーラを実行したことがありません。これらが問題です。

  1. WiX を使用して、すべてのファイル (インストーラー) を含むディレクトリを msi に埋め込む方法がわかりません。
  2. msi のみを実行する方法がわかりません (データをインストールするべきではなく、インストール時に組み込みの IS setup.exe のみを実行し、後で削除する必要があります)。
  3. インストール中にexeを実行する方法がわかりません。

これは、これまでに作成した *.wxs ファイルです。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="ISSetupPackeger" Language="1033" Version="1.0.0.0" Manufacturer="MyCompany" UpgradeCode="8804d459-2ea5-4bbc-85f7-dfc8419cafe4">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Id="*" InstallPrivileges="elevated" />

        <!-- TODO setup.exe starts but we don't want to run it using cmd -->
        <CustomAction Id="LaunchInstaller" Directory="InstallerDir" ExeCommand="cmd /C setup.exe" Impersonate="yes" Return="ignore" />
        <InstallExecuteSequence>
            <Custom Action="LaunchInstaller" After="InstallFinalize" />
        </InstallExecuteSequence>

        <Media Id='1' Cabinet='data.cab' EmbedCab='yes'/>
            <Feature Id="ProductFeature" Title="WixInstallerProject" Level="1">
                <ComponentGroupRef Id="ProductComponents" />
            </Feature>

        <!-- TODO How to extract files to temp dir? Is there some TEMP constant? -->
        <Directory Id="TARGETDIR" Name="SourceDir" >
            <Directory Id="TempDir" Name="inst">
                <Directory Id="InstallerDir" Name="Installer"/>
            </Directory>
        </Directory>

        <!-- component group which will be installed into tempdir -->
        <ComponentGroup Id="ProductComponents" Directory="InstallerDir">
            <Component Id="Installer" Guid="7b8bd37f-7eda-4c3a-8155-9dae1a6bbf98">
                <!-- TODO How to embed directory with all its files/subdirectories? -->
                <File Id="_Setup.dll" Name="_Setup.dll" DiskId="1" Source="installer\_Setup.dll"/>
                <File Id="data1.cab" Name="data1.cab" DiskId="1" Source="installer\data1.cab"/>
                <File Id="data1.hdr" Name="data1.hdr" DiskId="1" Source="installer\data1.hdr"/>
                <File Id="data2.cab" Name="data2.cab" DiskId="1" Source="installer\data2.cab"/>
                <File Id="data2.hdr" Name="data2.hdr" DiskId="1" Source="installer\data2.hdr"/>
                <File Id="ISSetup.dll" Name="ISSetup.dll" DiskId="1" Source="installer\ISSetup.dll"/>
                <File Id="layout.bin" Name="layout.bin" DiskId="1" Source="installer\layout.bin"/>
                <File Id="setup.exe" Name="setup.exe" DiskId="1" Source="installer\setup.exe"/>
                <File Id="setup.ini" Name="setup.ini" DiskId="1" Source="installer\setup.ini"/>
            </Component>
        </ComponentGroup>

    </Product>

</Wix>
4

2 に答える 2

1

いくつかの代替案:

ファイルから、InstallShield で作成したインストーラーは、InstallScript 非 MSI インストーラーのようです。InstallShield コンバーターを使用して、InstallScript MSI インストーラーに変換できる場合があります。この質問と回答を参照してください。

MSI への変換要件について、あなたとは異なる方法で読みました。あらゆる種類のラッピングまたは変換を有効にするには、実際にインストールされるファイルのインストールを管理する Windows インストーラーを利用する必要があります。そのためには、変換が不可能な場合は、インストーラーを最初から書き直す必要があります。このアプローチでは、MSI をバンドルとして使用するだけです。やりたいことを明確にする必要があります。

バンドル ルートを使用する場合、WiX はBurnと呼ばれるブートストラップ/ダウンローダー/チェイナー/バンドラーを提供するようになりました。これにより、既存のインストーラーを抽出して実行する単一の .exe を作成できます。また、必要に応じて、InstallShield 応答ファイルを作成して、既存のインストールをサイレント モードで実行することもできます。(これについては、InstallShield のドキュメントを参照してください。)

于 2013-07-31T14:03:26.840 に答える
0

WiX Bootstrapper を使用して、既存の InstallShield 実行可能ファイルを埋め込むことができます。変換は必要ありません。

この場合、InstallShield からビルドされた Setup.exe には、実際に MSI が含まれています。(これは通常の場合だと思います)。したがって、次の 2 つのオプションがあります。
- その MSI を抽出し (google "extract MSI from InstallShield")、MsiPackage を使用してブートスタッパーに
埋め込むか、ExePackage を使用して Setup.exe 全体を埋め込むことができます。

パラメータを MSI に渡す: 簡単

<MsiPackage Id="bla" SourceFile="path-to-msi>
  <MsiProperty Name="PUBLIC_PROPERTY_IN_UPPERCASE" value="yourvalue"/>
</MsiPackage>

InstallShield Setup.exe へのパラメータの受け渡し: トリッキー
この場合、Setup.exe は最終的に MSI にパラメータを渡します。/v"the-parameters-go-here-but-you-have-to-escape-properly" を使用します。
簡単に聞こえますが、スラッシュ (\)、一重引用符 (')、二重引用符 (") を適切にエスケープするのは複雑でした。また、InstallArgument 全体が ' (一重引用符) または " (二重引用符) で囲まれている場合、WiX は別の方法で \ をエスケープします。引用符)。簡単に見えたので一重引用符で始めましたが、最終的に二重引用符を使用しました。インストール ログを使用して、実際に各層を通過するものを確認します。

<Wix> 
  <Bundle>

  <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
      <bal:WixStandardBootstrapperApplication
        xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
        LicenseUrl=""/>
  </BootstrapperApplicationRef>

  <!-- rumor has it Windows Installer needs the trailing slash for paths -->
  <Variable Name="InstallPath" Value="C:\path\to\destination\on\target\machine\" Type="string" bal:Overridable="yes"/>


  <Chain>  
    <MsiPackage Id="package_your_msi"
                SourceFile="path-to-msi"
                DisplayInternalUI="no"
                ForcePerMachine="yes"
                Compressed="yes"
                After="package_some_other_msi">
      <MsiProperty Name="TEST_PROPERTY_5" Value="5"/>
    </MsiPackage>      


    <ExePackage Id="package_installshield_setup_exe"
                SourceFile="C:\path\to\Setup.exe"
                Compressed="yes" 
                PerMachine="yes">
        <CommandLine InstallArgument="/s /v&quot;/qn INSTALLDIR=\&quot;[InstallPath] \&quot; HOST_ADDRESS=[HostAddress] HOST_PORT=[HostPort] SCANNER_MODEL=[ScannerType]&quot;"
                     Condition="use_registry_values=1 AND other_cond=1"/>
        </ExePackage>
  </Bundle>
</Wix>

ソース:
https://social.msdn.microsoft.com/Forums/windows/en-US/1a113abd-dca1-482b-ac91-ddb0dcc5465c/is-it-possible-to-pass-commandline-arguments-to-an- installshield-executable?forum=winformssetup

http://helpnet.installshield.com/installshield22helplib/helplibrary/IHelpSetup_EXECmdLine.htm

于 2016-09-22T18:23:56.453 に答える