문제

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 컴퓨터에서 동일합니다.

도움이 되었습니까?

해결책

I have figured out why this is happening.

With the WiX installer being compiled on a x86 platform, Windows 7 picked it up as the 32-bit installer with 32-bit registry keys. Windows 7 64-bit handles 32-bit registry entries by doing just what I saw happening.

The program was still registered; it was just not in the 64-bit portion of the registry. Compile it under a x64 platform while making the necessary changes to make it for a 64-bit system (ProgramFileFolder become ProgramFiles64Folder, etc.), and it will put things in the right place.

다른 팁

기본적으로 나를 위해 이것을 해결해 주셔서 감사합니다!

나는 당신이 이것이 작동하기 위해 모든 것을 x64로 변경할 필요는 없다고 덧붙이고 싶었습니다. 해당 구성 요소 만 x64로 표시해야합니다.

<Component Id="MyShellExtension64.dll" Guid="..." Win64="yes">
  <Condition>VersionNT64</Condition>
  <File
    Name="MyShellExtension64.dll"
    Source="MyShellExtension64.dll"
    KeyPath="yes"/>
  <RegistryValue
    Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved"
    Name="{GUID}" Value="My Shell Extension" Type="string"/>
</Component>

참고 Win64 = "예", 이것이 레지스트리의 64 비트 영역에 편지를 쓰는 데 필요한 전부입니다. versionnt64 조건은이 구성 요소가 x64 시스템에만 설치되도록합니다.

필자의 경우 32 비트 프로그램 파일 폴더에 64 비트 구성 요소를 설치하고 싶기 때문에 ICE80 경고를 제공합니다. 메인 애플리케이션은 X64가 아니기 때문에 쉘 확장 만이므로 쉘 확장을 자체 특수 폴더에 넣고 싶지 않기 때문에이를 무시하게되어 기쁩니다.

Windows 7에서 특정 레지스트리 키를 처리하는 방법에는 몇 가지 차이점이 있습니다.Windows 7부터 레지스트리 반영이 제거되었습니다.이것이 당신이 여기서 보고 있는 것과 관련이 있는지는 확실하지 않지만 확인해 보세요. 이 링크 자세한 내용은.

또한 64비트 버전의 Windows 7을 사용하는 경우 다음을 참조하여 몇 가지 세부 사항을 자세히 알아볼 수 있습니다. MSDN 64비트 Windows 프로그래밍 가이드.

또한 Windows 버전(XP, Vista, 7 등)에 따라 다른 위치에 다른 레지스트리 키를 설치해야 하는 경우 이 스택 오버플로 질문 당신을 위한 답도 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top