Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-780

Allow Apache Directory Studio to be pinned to Windows 7's taskbar

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.3, 2.0.0-M1 (2.0.0.v20120111), 2.0.0-M2 (2.0.0.v20120127)
    • Component/s: studio-installer
    • Labels:
      None
    • Environment:
      Windows 7 64 bit SP1

      Description

      Hello
      I've noticed one more thing.
      I'm using the Windows 7 style taskbar where you can "pin" applications to the taskbar.
      In this case I've pinned the Apache Directory Studio icon from the startmenu which points to: "C:\Program Files\Apache Directory Studio\Apache Directory Studio.exe"
      When clicking on the icon in the taskbar it starts Studio as it should but then the icon should change into the icon of the running app.
      This doesn't happen with Studio 2M2. The icon is changed while Studio is loading and it even has a nice progress bar shown in the taskbar, then when it has loaded the icon is changed back as if the app isn't running and another icon for the running Studio is displayed.
      I'm not marking this as a bug since it could be by design to allow loading several Studio instances at once? In this case PuTTY has a nicer way of doing it, since you can right click on the running instance in the taskbar and start a new instance.

        Issue Links

          Activity

          Hide
          Pierre-Arnaud Marcelot added a comment - - edited

          Hi Aleks,

          I think I see the issue but some screenshots might help (if you can).

          We depend on Eclipse for these kind of functionalities and it seems there's an open issue about that on their bug tracking system.
          https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805

          I'll try to borrow a Win 7 system from a colleague to try different things.

          Show
          Pierre-Arnaud Marcelot added a comment - - edited Hi Aleks, I think I see the issue but some screenshots might help (if you can). We depend on Eclipse for these kind of functionalities and it seems there's an open issue about that on their bug tracking system. https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805 I'll try to borrow a Win 7 system from a colleague to try different things.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          I tried the workaround from the Eclipse bug report on my colleague's system and it works.

          We created a 'Apache Directory Studio.ini' file aside the 'Apache Directory Studio.exe' executable.
          In this file we added the following:
          -vm
          C:\Program Files\Java\jre6\bin
          Then we launched Studio and waited until it finished.
          We pinned it afterwards and it worked.

          Show
          Pierre-Arnaud Marcelot added a comment - I tried the workaround from the Eclipse bug report on my colleague's system and it works. We created a 'Apache Directory Studio.ini' file aside the 'Apache Directory Studio.exe' executable. In this file we added the following: -vm C:\Program Files\Java\jre6\bin Then we launched Studio and waited until it finished. We pinned it afterwards and it worked.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          We could probably automate the creation of the .ini file during the installation with a detection of the installed JRE.
          The end user would only need to wait for Studio to be completely loaded before pining it down to the taskbar.

          Show
          Pierre-Arnaud Marcelot added a comment - We could probably automate the creation of the .ini file during the installation with a detection of the installed JRE. The end user would only need to wait for Studio to be completely loaded before pining it down to the taskbar.
          Hide
          Aleks M added a comment -

          Hello
          The workaround you describe worked for me.

          Show
          Aleks M added a comment - Hello The workaround you describe worked for me.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Great!

          I'll see if I can include some code for the detection of the JRE in the Windows installer.
          The user would then be able to pin the application to the taskbar once it is fully initialized.

          Show
          Pierre-Arnaud Marcelot added a comment - Great! I'll see if I can include some code for the detection of the JRE in the Windows installer. The user would then be able to pin the application to the taskbar once it is fully initialized.
          Hide
          Aleks M added a comment -

          In my case I have three 32-bit JDKs installed, 1.5, 1.6 and 1.7 + two JREs, 1.6 and 1.7. I also have one 64-bit JDK, 1.6 and two 64-bit JREs, 1.6 and 1.7. Everything on the same machine...
          So I can test the installer and see what it detects

          Show
          Aleks M added a comment - In my case I have three 32-bit JDKs installed, 1.5, 1.6 and 1.7 + two JREs, 1.6 and 1.7. I also have one 64-bit JDK, 1.6 and two 64-bit JREs, 1.6 and 1.7. Everything on the same machine... So I can test the installer and see what it detects
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Great!

          Then, I will definitely ask you to test it (when ready).

          Thanks again, you're really helping us a lot.

          Show
          Pierre-Arnaud Marcelot added a comment - Great! Then, I will definitely ask you to test it (when ready). Thanks again, you're really helping us a lot.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Aleks,

          I opened a dedicated issue for an improvement on the Windows installer, see DIRSTUDIO-782 (Improve Windows installer with JRE detection and creation of 'Apache Directory Studio.ini' file).

          I have built a x86_64 version of the installer for you to test, if you don't mind.

          It's available here:
          http://people.apache.org/~pamarcelot/ApacheDirectoryStudio-win32-x86_64-2.0.0-SNAPSHOT.exe

          Thanks!

          Show
          Pierre-Arnaud Marcelot added a comment - Aleks, I opened a dedicated issue for an improvement on the Windows installer, see DIRSTUDIO-782 (Improve Windows installer with JRE detection and creation of 'Apache Directory Studio.ini' file). I have built a x86_64 version of the installer for you to test, if you don't mind. It's available here: http://people.apache.org/~pamarcelot/ApacheDirectoryStudio-win32-x86_64-2.0.0-SNAPSHOT.exe Thanks!
          Hide
          Aleks M added a comment -

          The installer automatically suggested the following this directory as the JRE directory:
          C:\Program Files (x86)\Java\jre7
          Even though it was wrong, since the 32-bit JRE resides under the x86 directory I decided to let it continue just to see what happens.
          The installation completed just fine but I couldn't start Studio of course since it was pointing to the wrong JRE. I got this error: Failed to load JNI shared library.
          I then ran the installer again so I could re-test it.and this time I manually selected the 64-bit JRE in C:\Program Files\Java\jre6 and Studio worked fine.
          How do you do the detection where the JRE is?

          Show
          Aleks M added a comment - The installer automatically suggested the following this directory as the JRE directory: C:\Program Files (x86)\Java\jre7 Even though it was wrong, since the 32-bit JRE resides under the x86 directory I decided to let it continue just to see what happens. The installation completed just fine but I couldn't start Studio of course since it was pointing to the wrong JRE. I got this error: Failed to load JNI shared library. I then ran the installer again so I could re-test it.and this time I manually selected the 64-bit JRE in C:\Program Files\Java\jre6 and Studio worked fine. How do you do the detection where the JRE is?
          Hide
          Pierre-Arnaud Marcelot added a comment - - edited

          I had exactly the same test on my colleague's system.

          To detect the JRE we're reading the Windows registry:
          > ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
          > ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome"

          I'm afraid it will be difficult to detect the 64 bit JVM on a 64 bit system.

          Now, that issue won't occur very often since most people will only have a single JRE installed and if they have multiple JREs, I guess they're clever enough to select the right one (like you noticed that the one selected by the installer would most probably fail because it was not a 64 bit JVM).

          So, all in all, I think we're good here.

          What do you think?

          BTW, I hope you were still able to pin the application to the taskbar after it successfully launched.

          Show
          Pierre-Arnaud Marcelot added a comment - - edited I had exactly the same test on my colleague's system. To detect the JRE we're reading the Windows registry: > ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" > ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome" I'm afraid it will be difficult to detect the 64 bit JVM on a 64 bit system. Now, that issue won't occur very often since most people will only have a single JRE installed and if they have multiple JREs, I guess they're clever enough to select the right one (like you noticed that the one selected by the installer would most probably fail because it was not a 64 bit JVM). So, all in all, I think we're good here. What do you think? BTW, I hope you were still able to pin the application to the taskbar after it successfully launched.
          Hide
          Aleks M added a comment -

          Hello

          Yes, I could pin the application just fine.

          I took a look at those keys in my registry and they actually point to the 64-bit JRE believe it or not:
          HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
          CurrentVersion: 1.6
          HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6
          JavaHome: C:\Program Files\Java\jre6

          I had to dig deeper to find out what was going on so I turned on ProcessMonitor and it turns out that the installer is reading another part of the registry, below Wow6432Node:

          HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment
          There my JavaHome points to C:\Program Files (x86)\Java\jre7

          My guess is that's because the installer is a 32-bit process but I have no proof of this.

          Show
          Aleks M added a comment - Hello Yes, I could pin the application just fine. I took a look at those keys in my registry and they actually point to the 64-bit JRE believe it or not: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment CurrentVersion: 1.6 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6 JavaHome: C:\Program Files\Java\jre6 I had to dig deeper to find out what was going on so I turned on ProcessMonitor and it turns out that the installer is reading another part of the registry, below Wow6432Node: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment There my JavaHome points to C:\Program Files (x86)\Java\jre7 My guess is that's because the installer is a 32-bit process but I have no proof of this.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Hi Aleks,

          Thanks for your interesting research.

          I updated the 64 bit installer to look for values into the 64 bit registry for the detection of the JRE.

          I updated the version of the installer here:
          http://people.apache.org/~pamarcelot/ApacheDirectoryStudio-win32-x86_64-2.0.0-SNAPSHOT.exe

          Could you give it a try please?

          Thanks!

          Show
          Pierre-Arnaud Marcelot added a comment - Hi Aleks, Thanks for your interesting research. I updated the 64 bit installer to look for values into the 64 bit registry for the detection of the JRE. I updated the version of the installer here: http://people.apache.org/~pamarcelot/ApacheDirectoryStudio-win32-x86_64-2.0.0-SNAPSHOT.exe Could you give it a try please? Thanks!
          Hide
          Aleks M added a comment -

          Hello

          It works great now, thanks.

          Show
          Aleks M added a comment - Hello It works great now, thanks.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Awesome!

          Thanks a lot for your help debugging this issue.

          Show
          Pierre-Arnaud Marcelot added a comment - Awesome! Thanks a lot for your help debugging this issue.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Edited the title, type, affect and fix versions of the issue.

          Show
          Pierre-Arnaud Marcelot added a comment - Edited the title, type, affect and fix versions of the issue.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Fixed with the updated Windows installer.

          The application can be pinned once it is fully loaded.

          Show
          Pierre-Arnaud Marcelot added a comment - Fixed with the updated Windows installer. The application can be pinned once it is fully loaded.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Closing the issue as version 2.0.0-M3 has been released now.

          Show
          Pierre-Arnaud Marcelot added a comment - Closing the issue as version 2.0.0-M3 has been released now.

            People

            • Assignee:
              Pierre-Arnaud Marcelot
              Reporter:
              Aleks M
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development