[SOLVED] Correct location for DLL under Windows 7 64-bit

Feature Requests, Comments, Bugs, and Suggestions on the JIntellitype Java API.

[SOLVED] Correct location for DLL under Windows 7 64-bit

Postby larsen » Thu Nov 17, 2011 11:06 am

Hi,

I have problems loading the DLL under a 64-bit Windows 7 (Prof, SP1). I use NSIS to get the correct version of the JIntellitype.dll installed for 32- or 64-bit:

${If} ${RunningX64}
!insertmacro InstallLib DLL "" REBOOT_NOTPROTECTED "${RESOURCEDIR}\JIntellitype64.dll" "$SYSDIR\JIntellitype.dll" "$SYSDIR"
${Else}
!insertmacro InstallLib DLL "" REBOOT_NOTPROTECTED "${RESOURCEDIR}\JIntellitype.dll" "$SYSDIR\JIntellitype.dll" "$SYSDIR"
${Endif}

On a 64-bit Windows 7 the file is installed to "C:\Windows\SysWOW64". However, when my program uses JIntellitype.isJIntellitypeSupported(), this returns false. When I use JIntellitype.setLibraryLocation("C:/Windows/SysWOW64/JIntellitype.dll") it works.

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

To which folder should the DLL be installed? Or should you fix something so the DLL is also loaded from the SysWOW64 folder?


Lars
User avatar
larsen
 
Posts: 8
Joined: Thu Nov 17, 2011 11:00 am

Re: Correct location for DLL under Windows 7 64-bit

Postby Melloware » Fri Nov 18, 2011 5:28 am

I think it needs to be on your path so in the same directory as where you are launching your app or in C:\Windows\System. Typically I don't install into C:
Windows\ I put in the same directory as my Executable JAR.

However for the 64 bit version I think you are safest doing what you are doing and forcing the "SetLibraryLocation".
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11017
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: Correct location for DLL under Windows 7 64-bit

Postby larsen » Fri Nov 18, 2011 6:32 am

Ok, I just tested this:

- same directory: works
- C:\Windows\System32: works

So, I will change my installer to simply install into the app-folder. Thanks for your help =)
User avatar
larsen
 
Posts: 8
Joined: Thu Nov 17, 2011 11:00 am

Re: Correct location for DLL under Windows 7 64-bit

Postby Melloware » Fri Nov 18, 2011 8:21 am

larsen wrote:Ok, I just tested this:

- same directory: works
- C:\Windows\System32: works

So, I will change my installer to simply install into the app-folder. Thanks for your help =)


No problem I will mark this solved!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11017
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA


Return to JIntellitype

Who is online

Users browsing this forum: No registered users and 1 guest