I made some improvements to the fix for this problem, and I've tested this under both ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0). I've noticed that there are some changes between the wx2.8 version and the wx3.0 version, the defaults for some settings have changed for wx3.0 which I can address in the future.
Also, the diff file attached is of an old trunk version (r6636), but the last change to the files in question was r6631.
I made some more improvements, I've now got almost all of the readme files connected up. The MUI readme doesn't launch at the moment because it has spaces in it's filename. Also, the examples link shows a proper folder window on wx3.0, but it launches an internet browser window on wx2.8. I also got the link for the NSIS manual to point to the html version on non-windows platforms. I still have to figure out why the links in the wx3.0 version aren't affected by the nslinks.cpp source file, they all just appear as valid links.
[edit] I haven't tested this under windows, but I have under ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0). [/edit]
Just letting you know that we are planning to ship the notinstalled.html file on all platforms now so you are allowed to navigate to it when appropriate if that helps you in any way.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cool, yeah I put that file in the install dir on ubuntu and it works as expected under wx2.8, but under wx3.0 the problem is different (the links are always valid so notinstalled.html is never displayed).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found out why the wx3.0 links were different, it's because the 'A' tag for the html parser can't be overridden (in wx2.8 they can). So the fix is pretty easy, just change the 'A' tags into 'NSLINK' tags, and now it functions the same on both.
Once again, not tested on windows but is tested on ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0).
I don't like the idea of changing the A tag either, but I will check the docs for the wx3.0 version as well. [edit] I found that at the bottom of nslinks.cpp, there is a class override but it's pointing to the wrong class. It should be 'Links', not 'CustomLinks', so we can leave the A tags as they are.[/edit]
Path handling, yeah, the next step is to try and condense the common parts of the code into helper functions, ideally I would like to move each link type (BIN, DOC, WEB) out to it's own helper function and have the platform defines in those.
Last edit: Jason 2016-06-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is a version that uses one common URL parser function. I cannot guarantee that it will even compile though but it works in my wxWidgets emulation framework that just host a native IE browser control.
It also seems to me like we almost don't need the tag handler, we could just do everything in MyFrame::OnLink() but as far as I can tell we would lose the custom URL color in that case. If you compile with NSISMENU_NOLINKTAGHANDLER defined it attempts to do this.
You just blew my attempt straight out of the water :). You patch does compile, but I did get a warning in nslinks.cpp about SUT_UNKNOWN not being handled within the switch statement. I also tried it without the tag handler, that works too. And it works on both wx2.8 and wx3.0.
I did try using the other version of BuildPath(), your compiler must be quite tolerant because my compiler (g++) gave several errors. The main one was 'can't convert wxString to const wxString (star symbol) ', fixing several of those errors caused another error, 'taking address of temporary'. We can't change the pointer of pbase because the compiler complains of 'not being able to pass non-trivially copyable class wxString through ...'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know it is not handled because it is not supposed to be, stupid compiler. Maybe a cast to int would shut it up?
I see I forgot to add the docs folder for the contents.html path, other than that it worked fine for me but there is a reason it's behind a #if 0 :) I like the idea but too much handholding for g++ would no longer make it a one-liner in the code. It is probably more expensive as well. It could be changed to take a wxChar pointer but that means adding .c_str() everywhere and there is no typechecking so it is very unsafe.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm surprised it broke. Under ubuntu it accepts "Links" with no warnings on both wx2.8 and wx3.0. The "Links" part is only for wx3.0 as "CustomLinks" has no effect. I don't know if it's the same for wx3.0 on windows.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made some improvements to the fix for this problem, and I've tested this under both ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0). I've noticed that there are some changes between the wx2.8 version and the wx3.0 version, the defaults for some settings have changed for wx3.0 which I can address in the future.
Also, the diff file attached is of an old trunk version (r6636), but the last change to the files in question was r6631.
I made some more improvements, I've now got almost all of the readme files connected up. The MUI readme doesn't launch at the moment because it has spaces in it's filename. Also, the examples link shows a proper folder window on wx3.0, but it launches an internet browser window on wx2.8. I also got the link for the NSIS manual to point to the html version on non-windows platforms. I still have to figure out why the links in the wx3.0 version aren't affected by the nslinks.cpp source file, they all just appear as valid links.
[edit] I haven't tested this under windows, but I have under ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0). [/edit]
Last edit: Jason 2016-06-17
Just letting you know that we are planning to ship the notinstalled.html file on all platforms now so you are allowed to navigate to it when appropriate if that helps you in any way.
Cool, yeah I put that file in the install dir on ubuntu and it works as expected under wx2.8, but under wx3.0 the problem is different (the links are always valid so notinstalled.html is never displayed).
I found out why the wx3.0 links were different, it's because the 'A' tag for the html parser can't be overridden (in wx2.8 they can). So the fix is pretty easy, just change the 'A' tags into 'NSLINK' tags, and now it functions the same on both.
Once again, not tested on windows but is tested on ubuntu 12.04 (wx2.8) and ubuntu 14.04 (wx3.0).
I'm not sure if I like the idea of changing the A tag. Are you sure this is by design in v3 and not just a bug?
There also seems to be a lot of new path handling here in multiple files, would it not be possible to abstract away some of this in a helperfunction?
I don't like the idea of changing the A tag either, but I will check the docs for the wx3.0 version as well. [edit] I found that at the bottom of nslinks.cpp, there is a class override but it's pointing to the wrong class. It should be 'Links', not 'CustomLinks', so we can leave the A tags as they are.[/edit]
Path handling, yeah, the next step is to try and condense the common parts of the code into helper functions, ideally I would like to move each link type (BIN, DOC, WEB) out to it's own helper function and have the platform defines in those.
Last edit: Jason 2016-06-19
Here is a version that uses one common URL parser function. I cannot guarantee that it will even compile though but it works in my wxWidgets emulation framework that just host a native IE browser control.
It also seems to me like we almost don't need the tag handler, we could just do everything in MyFrame::OnLink() but as far as I can tell we would lose the custom URL color in that case. If you compile with NSISMENU_NOLINKTAGHANDLER defined it attempts to do this.
You just blew my attempt straight out of the water :). You patch does compile, but I did get a warning in nslinks.cpp about SUT_UNKNOWN not being handled within the switch statement. I also tried it without the tag handler, that works too. And it works on both wx2.8 and wx3.0.
I did try using the other version of BuildPath(), your compiler must be quite tolerant because my compiler (g++) gave several errors. The main one was 'can't convert wxString to const wxString (star symbol) ', fixing several of those errors caused another error, 'taking address of temporary'. We can't change the pointer of pbase because the compiler complains of 'not being able to pass non-trivially copyable class wxString through ...'.
I know it is not handled because it is not supposed to be, stupid compiler. Maybe a cast to int would shut it up?
I see I forgot to add the docs folder for the contents.html path, other than that it worked fine for me but there is a reason it's behind a #if 0 :) I like the idea but too much handholding for g++ would no longer make it a one-liner in the code. It is probably more expensive as well. It could be changed to take a wxChar pointer but that means adding .c_str() everywhere and there is no typechecking so it is very unsafe.
I just added 'case SUT_UNKOWN:' above 'case SUT_WEB:' to get rid of that warning.
I am unable to build on Windows with
CustomLinks
renamed toLinks
. I get:I'm going to change it back for 3.0rc2. Let me know if it breaks wx3 Linux and then maybe we can add
#ifdef __WXMSW__
if there is no better solution.Last edit: Amir Szekely 2016-07-09
I'm surprised it broke. Under ubuntu it accepts "Links" with no warnings on both wx2.8 and wx3.0. The "Links" part is only for wx3.0 as "CustomLinks" has no effect. I don't know if it's the same for wx3.0 on windows.
The makensisw link still points nowhere, makensisw is Windows-only.