bugGNU Octave - Bugs: bug #47527, Octave pinned on Windows 7...

 
 

bug #47527: Octave pinned on Windows 7 taskbar, icon appearance changes

Submitter:  None
Submitted:  Thu 24 Mar 2016 06:33:54 PM UTC
   
 
Category:  GUI Severity:  2 - Minor
Priority:  3 - Low Item Group:  Other
Status:  Fixed Assigned to:  lostbard
Originator Name:  Kent Deines Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.1
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 05 Oct 2016 06:05:09 PM UTC, comment #42: 

Just a funny observation in connection with this recent change (observed with Octave-4.2.0-rc2 under Windows). This is what I did:

  • Create a new Windows environment variable, let's say TESTVAR with the content "test".
  • Start Octave GUI via the vbs script.
  • do "getenv('TESTVAR')", the result will be an empty string. (This seems to be correct, I don't know why. Or is this a bug?)
  • right click on the Windows task bar to "attach" the Octave program onto the task bar.
  • close Octave GUI
  • start Octave GUI again, this time via clicking on the newly created taskbar icon
  • do "getenv('TESTVAR')". This time the result will not be empty, in my case it contains "test".


Conclusion: Starting Octave via the vbs-script does some DIFFERENT handling of Windows environment variables, compared to starting it via the task bar icon (that can now be easily created, because of the appid change.)

Note: The important environment varialble PATH is totally the same inside of Octave, with both methods to start it. No problem with this.

Looking at the vbs script, I would guess that this behavior might results in the variables TERM, GNUTERM, GS or QT_PLUGIN_PATH being affected by this (But I haven't tried this so far).

Hartmut <hardy>
Fri 12 Aug 2016 12:01:59 AM UTC, comment #41: 

Sounds fixed to me, done.

Mike Miller <mtmiller>
Group Member
Thu 11 Aug 2016 11:24:03 PM UTC, comment #40: 

My vote would be noone one would want to attach  :)

Im all for closing the issue as fixed, unless anyone feels strongly about adding the appid to the CLI versions as well?

John Donoghue <lostbard>
Group Member
Tue 09 Aug 2016 09:40:50 PM UTC, comment #39: 

Wonderful, this works!

I've made a new nsis-installer with the latest mxe-octave patch. And now I can use both link files (the one on the desktop as well as the one in the start menu) to create a taskbar icon. It works fine to drag-and-drop those links to the task bar. And it also works to just start Octave with one of those link file, and afterwards right-click on the running taskbar icon to "attach this to the taskbar permanently". Even making a file copy of the link file into a different folder, and then dragging-and-dropping to the taskbar works fine. So, as long as I only use those link file, it behaves perfectly as a Windows user expects it and is used to it. Thanks for fixing this!

Note: I've personally never used those, but would it make sense, to also add both "Octave (CLI)" link files to the same Octave appid-family (or should those form a second Octave family)? Would anyone want to attach those to the Windows taskbar at all?

As far as I am concerned, this issue is fully fixed and could be closed now.

Hartmut <hardy>
Tue 09 Aug 2016 08:51:54 PM UTC, comment #38: 

Pushed http://hg.octave.org/mxe-octave/rev/393571034f24


You will need to rerun configure in mxe-octave in order to ensure the changes to the makeinst script get used.


John Donoghue <lostbard>
Group Member
Tue 09 Aug 2016 07:47:08 PM UTC, comment #37: 

That already works for me - at least when running the start menu shortcut and doing it

Anyone else tried and been successful?

John Donoghue <lostbard>
Group Member
Tue 09 Aug 2016 07:29:36 PM UTC, comment #36: 

Does the fix proposed here also solve the scenario where the user launches Octave (via either shortcut), and right-clicks on the task bar icon of the running instance of Octave to pin it?

Mike Miller <mtmiller>
Group Member
Tue 09 Aug 2016 07:26:50 PM UTC, comment #35: 

ok - that makes it clear on whats happening

yes  - we should be eble to set the applink on the desktop icon easily





John Donoghue <lostbard>
Group Member
Tue 09 Aug 2016 06:55:18 PM UTC, comment #34: 

I have compiled a fresh version of mxe-octave, and I have done as JohnD suggested in comment #29. The result of the win7appid command is

current AppID: gnu.octave


At the same time I have re-done my tests, and I still DO see the very same behavior as in my comment #16.

Nevertheless, I now eventually understood how it's supposed to work, and why this didn't seem to work for me:

  • THIS WORKS FINE: If I go to the start menu, and right click on the entry "Octave (GUI)" in order to "attach to the task bar". Then I do get a new link in my taskbar. It has the correct Octave icon. And when I press it, Octave starts, and no second task appears in the task bar. Everything is fine. I think this is what JohnD intended to do.


  • THIS DOES NOT WORK: If I take the shortcut icon on the Destop (!) with the name "Octave-4.1.0 (GUI)" and drag-and-drop it to the taskbar, then it attaches there with the wrong icon. Extending its link target with the string "wscript.exe " in front, corrects the icon. But starting this taskbar entry creates a second icon in the task bar. (This is what I described in comment #16 and comment #8).


So this patch does help as intended with attching the icon to the Windows taskbar. But only if you use the link from the start menu. It does NOT work if you try to use the link from the desktop.

My CONCLUSION / WISH: Could we extend this patch, such that also attaching the DESKTOP link to the taskbar will work as expected?

I am not sure where the difference in behavior between the two link files comes from. They do have the very same target string "...octave.vbs --force-gui". Maybe the different behavior is due to

  • their different Windows "owner": The link file on the desktop is owned by the normal Windows user, the link file in the start menu is owned by the Windows admin user.
  • their different file name. The link on the desktop is "Octave-4.0.1 (GUI).lnk" and the link in the start menu is "Octave (GUI).lnk" without the version number in the file name.
  • the different folder where the two generated link files sit in.


@JohnD: Would this be possible with the win7appid.exe to add the Desktop link file to this same "app id family" as well?

Hartmut <hardy>
Sun 07 Aug 2016 11:41:31 PM UTC, comment #33: 

The sparsersb package updated anyway, which requires the newer librsb, so pushed a changeset to update both: http://hg.octave.org/mxe-octave/rev/fc1bee8ff2d4

John Donoghue <lostbard>
Group Member
Sun 07 Aug 2016 10:21:21 PM UTC, comment #32: 

It appears that old source packages are moved after they are no longer the last release.  What was previously 1.2.0-rc2 at http://sourceforge.net/projects/librsb/files/librsb/ is now in https://sourceforge.net/projects/librsb/files/oldrc/ maybe because the current rc is rc4 .

Carnë Draug <carandraug>
Group Member
Sun 07 Aug 2016 10:07:32 PM UTC, comment #31: 

should be easy - will take a look

John Donoghue <lostbard>
Group Member
Sun 07 Aug 2016 06:06:34 PM UTC, comment #30: 

@JohnD: I know it's slightly off-topic: But I'm currently unable to build mxe-octave from scratch, because the package "librsb" can't be downloaded of any of the three sites. Since you seem to be into mxe-octave, is that easy to fix?

Hartmut <hardy>
Sat 06 Aug 2016 12:50:54 PM UTC, comment #29: 

Can you rerun the mxe-octave configure with the --enable-devel-tools included.

After installing octave, go to the Octave 4.1.0 menu on the start bar and select 'Bash Shell'

In bash, cd to the octave 4.1.0 start menu folder (on mine it ss at)


cd "/c/ProgramData/Microsoft/Windows/Start Menu/Programs/Octave-4.1.0"



Then run the appid read command:


win7appid.exe "Octave (GUI).lnk"


and see what it prints.




John Donoghue <lostbard>
Group Member
Fri 05 Aug 2016 12:03:48 PM UTC, comment #28: 

Yes, I have only ever tested those new mxe-octave versions on a single Win7 (64bit) machine.

Hartmut <hardy>
Fri 05 Aug 2016 12:03:39 PM UTC, comment #27: 

I have moved to Windows-10, and it works there.
Later, I will try in a Win-7 machine.

Avinoam Kalma <avinoam>
Group Member
Fri 05 Aug 2016 12:32:08 AM UTC, comment #26: 

Can I assume it is Win7  64 bit?

John Donoghue <lostbard>
Group Member
Thu 04 Aug 2016 06:37:02 PM UTC, comment #25: 

Here is what I did for my mxe-octave build:

  • I created a clean copy of the mxe-repository (hg id 3fc30cd416ac).
  • I used the automatically downloaded default-octave from the Hydra build daemon, yesterday night. But since your changes in the Octave repo are some weeks ago, they should definitly be in there, now.


cd mxe-octave-repo
export JAVA_HOME=/usr/lib/jvm/default-java
autoconf
./configure --enable-octave=default
make nsis-installer


Also Avinoam has stated in comment #18, that his mxe-octave build did not fix this issue. And according to my reading of the mxe-octave repository history, the diverging heads did NOT prevent us previously from building mxe-octave with the relevant patches included.

@Avinoam: Could you also try again?

Hartmut <hardy>
Thu 04 Aug 2016 10:19:25 AM UTC, comment #24: 

What mxe-octave configure options do you use ?


John Donoghue <lostbard>
Group Member
Thu 04 Aug 2016 10:18:03 AM UTC, comment #23: 

Weird - works on my win10 and a win7 machine.

John Donoghue <lostbard>
Group Member
Thu 04 Aug 2016 06:17:50 AM UTC, comment #22: 

Sorry, but with today's fresh mxe-octave build, I still get the very same behavior as in comment #16. I don't see any improvement so far :(

Hartmut <hardy>
Tue 02 Aug 2016 11:59:51 PM UTC, comment #21: 

Try again - it looks like when I pushed the changes to mxe-octave they diverged from the default branch.

John Donoghue <lostbard>
Group Member
Sun 24 Jul 2016 07:44:47 PM UTC, comment #20: 

Works for me, however I did manually set the icon appid prior to getting it working with nsis, so perhaps it is caching settings that everyone else is not getting

I will try to get access to another windows machine and see if doesnt work for me there.

John Donoghue <lostbard>
Group Member
Sun 24 Jul 2016 02:51:02 PM UTC, comment #19: 

My observations in comment #16 were are already done with an mxe-octave, compiled with the configure option "--enable-octave=default". Does anyone see a different behavior?

Hartmut <hardy>
Fri 22 Jul 2016 09:02:46 PM UTC, comment #18: 

I have compiled the dev. branch under MXE, but I see the same
behavior that @Hartmut described in comment #16

Avinoam Kalma <avinoam>
Group Member
Fri 22 Jul 2016 02:37:47 PM UTC, comment #17: 

The change was pushed to the default branch of octave, not stable, so you need to compile mxe-octave with  a default branch octave

Probally at that point need to configure mxe-octave with --enable-octave=default


John Donoghue <lostbard>
Group Member
Fri 22 Jul 2016 01:37:03 PM UTC, comment #16: 

I have compiled a recent mxe-octave, and this still DOES not seem to work. Here are the details:

  • I used mxe-octave with the hg id a543952ed731 . This includes all of JohnD's patches to this topic


  • mxe-Octave downloads "stable-octave" and this seems to have an hg id of (at least) ff54e7882863 . I have conluded this, because the file octave-gui.cc has the line "include <windows.h>" added already.


I created a nsis-installer. Here is how the generated shortcuts behave, when you try to use them as taskbar starters:

  • When you drag-and-drop the generated Octave links directly to the taskbar, then they will attach. But the icon still changes to something differnt, I think the vbs icon. (This behavior is identical to the first point of comment #8 )


  • When you change the "target" string of those shortcut files, and add "wscript.exe " in front, then those changed shortcuts will also properly attach to the taskbar. But once you press them Octave GUI starts and still opens a second icon in the taskbar. (This behavior is identical to the second point of comment #8 ).


So I could not find any positive change of those patches yet. Am I doing something wrong?


Hartmut <hardy>
Wed 20 Jul 2016 08:44:26 PM UTC, comment #15: 
John Donoghue <lostbard>
Group Member
Wed 20 Jul 2016 12:25:04 PM UTC, comment #14: 

Setting the appusermodelid in the shortcut: http://hg.octave.org/mxe-octave/rev/a543952ed731

John Donoghue <lostbard>
Group Member
Tue 19 Jul 2016 08:48:04 PM UTC, comment #13: 

ok - I think I have it.

There are 3 parts to doing it:

1. call setCurrentProcessExplicitAppUserModelID in Octave-gui if we can (patch attached)

2. Add win7appid program to mxe-octave - http://hg.octave.org/mxe-octave/rev/2b631cf1c210

3. set the appusermodelid in the shortcut from the nsis-installer - in progress.

All 3 parts need to be done in order for it to work

(file #37953)

John Donoghue <lostbard>
Group Member
Mon 18 Jul 2016 08:21:11 PM UTC, comment #12: 

The link works, once Javascript is enabled. Sorry for the noise.

Hartmut <hardy>
Mon 18 Jul 2016 08:16:21 PM UTC, comment #11: 
John Donoghue <lostbard>
Group Member
Mon 18 Jul 2016 08:11:36 PM UTC, comment #10: 

(@John: The link in comment #9 doesn't work.)

Hartmut <hardy>
Mon 18 Jul 2016 08:03:39 PM UTC, comment #9: 

Yep - needs the appid as per comment #3


There is a BSD licensed app:https://code.google.com/archive/p/win7appid which looks promising on helping to set that.

John Donoghue <lostbard>
Group Member
Mon 18 Jul 2016 07:00:38 PM UTC, comment #8: 

I have tried several ways to pin a "Octave launcher" somehow to the Windows 7 taskbar. And I found that NONE of the ways that came to my mind worked:

  • When you drag-and-drop the automatically generated Octave links (like "Octave 4.0.3 (GUI)" from the Desktop (or from the Windows start menu folder) to the taskbar, then it will attach there. But it will show the WRONG ICON. I think it is the icon of the vbs interpreter.


  • When you change the link target of those automatically generated Octave links from "...\octave.vbs --force gui" to "wscript.exe ...\octave.vbs --force gui" then it will still attach there and it will then show the correct Octave icon. But once you start Octave via this icon, a SECOND Octave ICON will appear in the taskbar. (This is the proposed workaround from commment #5.)


  • When you try to attach the octave.bat file to the start menu, it just WON'T ATTACH.


  • When you create a link to the vbs-file and attach this link to the taskbar, it will appear there with a wrong icon. (This is basically the same as the first method.) And it does not help to manually define the correct Octave icon-file for the link-file. The taskbar entry will nevertheless show the wrong icon after attaching it there.


  • If you create a link file to .../bin/octave-gui.exe, and manually define the Octave icon-file as icon for this, then this link file can be properly attached to the taskbar. And it will show the correct Octave icon. And it will stay there once you press it (and not generate a second Octave icon in the taskbar.) But in this case the ENVIRONMENT VARIABLES are NOT PROPERLY SET for the Octave binaries. This is what happend to me in bug #48484.


(This was tested with the official Windows binary installer of Octave 4.0.3.)

Since attaching some kind of "software launch button" to the Windows taskbar is something that many people (at least me) consider "normal" for a Windows software, I would very much to have this possibility also with Octave.

Hartmut <hardy>
Fri 15 Jul 2016 05:59:28 PM UTC, comment #7: 

This behavior is still present in the (mxe-)Octave release 4.0.3 for Windows.

And this behavior is not only a cosmetic issue. Anyone who uses Octave seriously under Windows OS will eventually try to create a launcher in the taskbar. This seems like the normal "Windows user behavior" to me.

There might be ways to work around this issue successfully (I haven't tried the proposed workaround from comment #6 yet). But there are also many ways to work around this, that can have serious side effects. See bug #48484 for an example.

Hartmut <hardy>
Mon 04 Apr 2016 11:14:08 PM UTC, comment #6: 

That will work - or at least is the work around for now.


It still doesnt fix it when someone tries from the other method.


John Donoghue <lostbard>
Group Member
Mon 04 Apr 2016 09:35:55 PM UTC, comment #5: 

Pinning the Octave icon to the taskbar didn't work at all for me (it seemed to launch the Windows script host, rather than running the script itself). The following workaround worked perfectly for me (retaining the correct icon).

1) Navigate to the folder containing the Octave start menu program listing (e.g. C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Octave-4.0.0).

2) Right-click the "Octave (GUI)" shortcut and create shortcut to this shortcut. Agree to place on Desktop (will be deleted later).

3) Right-click the newly created shortcut and click "Properties". Prefix the target with wscript.exe.

4) Drag the shortcut onto the taskbar.

5) Delete the shortcut.

Anonymous
Tue 29 Mar 2016 08:46:51 PM UTC, comment #4: 

The reason the icon is wrong is that the octave binary itself has a default binary icon.

The shortcut in the start menu has one assigned to it in the lnk file.

Pinning (without the app id) uses the icon of the binary (the default icon)

Also pinning then created a short cut to the binary instead of the .vbs file, so any setup in the vbs file at that point is not used when launched from the pinned shortcut.

John Donoghue <lostbard>
Group Member
Sun 27 Mar 2016 08:03:51 PM UTC, comment #3: 

Thats also the same with the offical 4.0.1 installer.

Looking on google, it appears to be a win8/9 issue several other programs have has and is related to AppUserModelID [1] in Windows.

It might be something we can set up in the registery during install or from the vb launcher script.


[1] https://msdn.microsoft.com/en-us/library/dd378459(VS.85).aspx





John Donoghue <lostbard>
Group Member
Sun 27 Mar 2016 07:49:43 PM UTC, comment #2: 

I can see the same if I pin GUI.

It appears to be like a 'defualt application' type icon, which may make sence, as we are specifying the octave icon in teh shortcuts of te installer, and pinning it probally tries to use an icon embedded in the application.



John Donoghue <lostbard>
Group Member
Fri 25 Mar 2016 04:34:48 PM UTC, comment #1: 

Thanks for the bug report. Is this still the case for you with the 4.0.1 official release?

Mike Miller <mtmiller>
Group Member
Thu 24 Mar 2016 06:33:54 PM UTC, original submission:  

When pinning octave in the windows 7 taskbar, the Octave icon changes to something else.
It shows in the taskbar properly when not pinned, but changes when pinned to something I don't recognize when pinned, but always works properly.
Kent

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37953:  setappid-octave.patch added by lostbard (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-12 mtmiller StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2016-07-20 lostbard StatusIn Progress Ready For Test
    2016-07-19 lostbard Attached File- Added setappid-octave.patch, #37953
    2016-03-27 lostbard CategoryDocumentation GUI
    2016-03-27 lostbard StatusNeed Info In Progress
        Assigned toNone lostbard
    2016-03-25 mtmiller CategoryNone Documentation
        Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Item GroupNone Other
        StatusNone Need Info
        Release4.0.1-rc1 4.0.1
        SummaryWhen pinning octave to the, the icon changes Octave pinned on Windows 7 taskbar, icon appearance changes

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code