#2995 Windows insaller puts wrong javaw.exe path for x64

closed-fixed
nobody
7
2007-12-16
2007-12-13
Uwe
No

I installed the new jEdit 4.3pre12 on Windows.

With the new installation, jEdit doesn't start when using the Windows File Explorer context menu or the start menu.

The reason is the new installer "feature" of using the javaw.exe in Windows system directory. This is an important feature but incorrectly implemented so that jEdit becomes useless for average users on x64 and Vista platforms:

The installer hardcodes the system directory to
C:\Windows\system32
but this folder is not the system folder on all Windows machines. I use for example WinXPx64 and there it is
C:\WINDOWS\SysWOW64
Note that on Vista it is also not system32!

So what needs to be done is to check what the current system folder is and use this when installing.

I case the installer is written in NSIS, you need to check the
$SYSDIR
variable, see section 4.2.3 of the NSIS documentation.

---

Please provide a new Win installer for pre12 when this bug is fixed.

Discussion

  • Uwe
    Uwe
    2007-12-13

    • priority: 5 --> 7
     
    • summary: installer bug in jEdit 4.3pre12 --> Windows insaller puts wrong javaw.exe path for x64
     
  • Logged In: YES
    user_id=1483238
    Originator: NO

    The installer is build on Inno Setup. It does what you said.
    The actual code is:
    > path := GetSystemDir + '\javaw.exe';
    > if FileExists(path) then begin
    (GetSystemDir is a function provided by Inno Setup.)

    While the code looks innocent, it caused this bug because of lack of
    knowledge about 64-bit Windows. See the following.
    "File System Redirector"
    http://msdn2.microsoft.com/en-us/library/aa384187.aspx

    Fortunately, Inno Setup provides another function GetSysWow64Dir. I'll
    try to fix this using the function.

    Note that I can't test it by myself because I have no 64-bit Windows
    box. Please let me know if someone can help.

     
  • Uwe
    Uwe
    2007-12-13

    Logged In: YES
    user_id=784127
    Originator: YES

    > I have no 64-bit Windows box. Please let me know if someone can help.

    When you send me the installer or upload it somewhere I'll test it.

     
  • Logged In: YES
    user_id=1483238
    Originator: NO

    Thank you for your help.

    While seaching for solutions, I'm now wondering how javaw.exe was placed
    in SysWOW64.

    I found this.
    http://java.sun.com/javase/6/webnotes/install/jre/install-windows-64.html
    > The public JRE installed with the 32-bit JRE is not registered.
    In that case, supporting javaw.exe in SysWOW64 seems not to work with
    JRE 6. It will fallback to javaw.exe in "C:\Program Files\...".

    Could you please provide some more information about the environment
    where the actual problem happened? What JRE, version of it and what
    version (edition) of Windows?

     
  • Uwe
    Uwe
    2007-12-14

    Logged In: YES
    user_id=784127
    Originator: YES

    > While seaching for solutions, I'm now wondering how javaw.exe was placed
    > in SysWOW64.

    The same way how javaw.exe is placed in the system32 directory.

    > I found this.
    > http://java.sun.com/javase/6/webnotes/install/jre/install-windows-64.html
    >> The public JRE installed with the 32-bit JRE is not registered.
    > In that case, supporting javaw.exe in SysWOW64 seems not to work with
    > JRE 6. It will fallback to javaw.exe in "C:\Program Files\...".

    I don't understand. When installing Java, the javaw.exe is also placed to the system directory.

    The webpage you mentioned lists:

    > * Online Installation and Java Update features are not applicable to 64-bit architecture.
    > * The public JRE installed with the 32-bit JRE is not registered. You must set the PATH
    > environment variable to point to JAVA_HOME \bin to register the JRE.

    Both is about "a 32 -bit JRE on a 64- bit Windows", but I have of course the 64bit version of the JRE. Therefore it is correctly registered and I get automatically the latest JRE updates.

    > Could you please provide some more information about the environment
    > where the actual problem happened? What JRE, version of it and what
    > version (edition) of Windows?

    I have the JRE 1.6.0_03 installed on a WinXp 64

     
  • Logged In: YES
    user_id=1483238
    Originator: NO

    Thank you for your quick reply. It seems that Sun's JRE 1.6.0_03 puts
    javaw.exe in SysWOW64 even if user chose the 64-bit installer.

    The attached patch checks SysWOW64 before System32. I uploaded an
    informal build from the tag "jedit-4-3-pre12" with the patch here.
    http://jedit.wiki.sourceforge.net/space/showimage/jedit4.3pre12install-testing-fix-for-BUG-1849762.exe
    (I'll remove this after testing.)

    I verified that this works same as the official release on my 32-bit
    WinXP. Please test this on 64-bit environments.

     
  • Logged In: YES
    user_id=1483238
    Originator: NO

    Sorry, I forgot to attach the patch.
    File Added: win32installer-fix-for-SysWOW64.patch

     
  • Uwe
    Uwe
    2007-12-16

    • status: open --> open-fixed
     
  • Uwe
    Uwe
    2007-12-16

    Logged In: YES
    user_id=784127
    Originator: YES

    > jedit4.3pre12install-testing-fix-for-BUG-1849762.exe
    > (I'll remove this after testing.)

    Many thanks for the quick fix. It works fine here on my 64bit system.

    Could you please update the pre12 installer accordingly (to avoid that others suffer from the same).

    Many thanks again and regards
    Uwe

     
  • Logged In: YES
    user_id=1483238
    Originator: NO

    Thank you for testing. I committed the patch in r11411.

    The installer issue was moved on jedit-devel.
    Subject: "Updating the 4.3pre12 Windows installer for 64-bit problem"

     
    • status: open-fixed --> closed-fixed