WiX は Windows 7 のインストール中に HKLM レジストリ設定を追加しません 質問する

WiX は Windows 7 のインストール中に HKLM レジストリ設定を追加しません 質問する

私は Windows XP で完璧に動作する WiX インストーラーを作成しましたが、Windows 7 ボックスにインストールするときにレジストリ エントリで問題が発生します。スタート メニューにプログラムを表示するためのレジストリ エントリだけでなく、HKLM エントリも追加する必要があります。両方のタイプのエントリに使用しているコードは次のとおりです。

<!-- Create the registry entries for the program -->
<DirectoryRef Id="TARGETDIR">
  <Component Id="RegistryEntriesInst" Guid="...">
    <RegistryKey Root="HKLM"
                 Key="Software\$(var.Manufacturer)\$(var.ProductName)"
          Action="createAndRemoveOnUninstall">
      <RegistryValue
          Type="string"
          Name="installed"
          Value="true"
          KeyPath="yes"/>
    </RegistryKey>
  </Component>
  <Component Id="RegistryEntriesVer" Guid="...">
    <RegistryKey Root="HKLM"
                 Key="Software\$(var.Manufacturer)\$(var.ProductName)"
          Action="createAndRemoveOnUninstall">
      <RegistryValue
          Type="string"
          Name="version"
          Value="$(var.ProductVersion)"
          KeyPath="yes"/>
    </RegistryKey>
  </Component>
</DirectoryRef>

<!-- To add shortcuts to the start menu to run and uninstall the program -->
<DirectoryRef Id="ApplicationProgramsFolder">
  <Component Id="ApplicationShortcut" Guid="...">
    <Shortcut Id="ApplicationStartMenuShortcut"
              Name="$(var.ProductName)"
              Description="..."
              Target="[SERVERLOCATION]$(var.Project.TargetFileName)"
              WorkingDirectory="SERVERLOCATION"/>
    <Shortcut Id="UninstallProduct"
                  Name="Uninstall $(var.ProductName)"
                  Description="..."
                  Target="[System64Folder]msiexec.exe"
                  Arguments="/x [ProductCode]"/>
    <RemoveFolder Id="SERVERLOCATION" On="uninstall"/>
    <RegistryValue
        Root="HKCU"
        Key="Software\$(var.Manufacturer)\$(var.ProductName)"
        Name="installed"
        Type="integer"
        Value="1"
        KeyPath="yes"/>
    </Component>
</DirectoryRef>

この問題を解決するにはどうすればいいでしょうか?

ちなみに、レジストリのアクセス許可は、Windows XP コンピュータと Windows 7 コンピュータで同じです。

ベストアンサー1

なぜこのようなことが起こるのか分かりました。

WiX インストーラーは x86 プラットフォームでコンパイルされているため、Windows 7 はそれを 32 ビット レジストリ キーを持つ 32 ビット インストーラーとして取得しました。Windows 7 64 ビットは、私が見たのと同じ動作で 32 ビット レジストリ エントリを処理します。

プログラムは登録されていますが、レジストリの 64 ビット部分には登録されていません。x64 プラットフォームでコンパイルし、64 ビット システム用に必要な変更を加えると (ProgramFileFolder を ProgramFiles64Folder にするなど)、適切な場所に配置されます。

おすすめ記事