[Solved] 64-bit mode & Write Registry Key

Got a problem you cannot solve? Try here.
phoffman
Posts: 19
Joined: Tue Jan 15, 2013 10:40 am

[Solved] 64-bit mode & Write Registry Key

Postby phoffman » Thu Jan 17, 2013 11:12 am

I can't seem to figure this one out. I've created a runtime that checks for the presence of the JRE and it works just fine. However, when I go to install the application in a Windows 7 VM without the JRE, my registry value is written to the SOFTWARE\Wow6432Node\Microsoft\Windows\HTML Help key instead of SOFTWARE\Microsoft\Windows\HTML Help. I verified that JRE_X86 & JRE_X64 are FALSE & ISWINDOWS64BIT is TRUE with a message box and it does enter the condition that is marked as non-functional. Can someone please help me figure out what I'm doing wrong here.

Code: Select all

  [DEFINE WEB MEDIA Java Utility Application]
  Get Component Java Utility Application Selection State into Variable SELECTED
  if Variable SELECTED Equals TRUE
    Set Variable PROGRESSTEXT to Installing Java Utility Application
     
    Comment: Install the files for the Java Utility Application to a writable
    Comment: location so the user can update the utility.
    Install Files C:\Installation Files\target\JUA\*.* to $TARGETDIR$\JUA, include subfolders
    Install Files C:\Installation Files\common\JUA\*.* to $ALLAPPDATA$\MANUFACTURER\PRODUCT\VER\JUA, include subfolders
     
    Comment: Create registry values for Java Utility Application. The registry entry
    Comment: location must not be in Wow6432Node unless the 32-bit JRE is installed on a
    Comment: 64-bit machine. Otherwise JUA cannot read the help location from the registry.

    if Variable JRE_X86 not Equals TRUE
      if Variable JRE_X64 not Equals TRUE
        Set Variable ISWINDOWS64BIT to FALSE
        Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
        if Variable ISWINDOWS64BIT Equals TRUE
          Comment: THIS DOESN'T WORK. IT STILL WRITES THE VALUE TO Wow6432Node.
          Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
          Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\HTML Help\JUA.chm, $TARGETDIR$\JUA
          Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
          else
          MessageBox: $TITLE$ Setup, not x64
          Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\HTML Help\JUA.chm, $TARGETDIR$\JUA
        end
        else
        Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
        Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\HTML Help\JUA.chm, $TARGETDIR$\JUA
        Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
      end
      else
      MessageBox: $TITLE$ Setup, x86
      Write Registry Key HKLM\SOFTWARE\Microsoft\Windows\HTML Help\JUA.chm, $TARGETDIR$\JUA
    end
  end
Last edited by phoffman on Thu Jan 17, 2013 1:54 pm, edited 1 time in total.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: 64-bit mode & Write Registry Key

Postby FrancescoT » Thu Jan 17, 2013 12:11 pm

Dear User,

you found this behaviour because the Write registry call is deferred to Apply Install call execution

In your code you are only switching from X64 to X86 native mode, but the Write registry call is a Window Installer command (purple Command) and it is not executed immediatelly.

In other words, when your code runs the Apply Install command, the Write registry is effectively executed, but the Set Native command has been restored back to x86 mode.

I suggest you to have a look at the InstallAware template "Native Setup", it describes very well how to handle your case.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

phoffman
Posts: 19
Joined: Tue Jan 15, 2013 10:40 am

Re: 64-bit mode & Write Registry Key

Postby phoffman » Thu Jan 17, 2013 1:54 pm

That seemed to do the trick. Now to review all the Native Engine Enhancements :)

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: [Solved] 64-bit mode & Write Registry Key

Postby FrancescoT » Fri Jan 18, 2013 3:39 am

Happy you solved! :D :D :D

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Baidu [Spider] and 94 guests