[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Menu

#1144 NSIS Menu not working properly under non-windows platforms

3.0 Alpha Series
closed-accepted
nobody
None
5
2017-01-03
2016-06-02
Jason
No

The NSIS Menu app under non-windows platforms always gives an error about not being able to load a webpage.

So I decided to create a fix for it, see attachment (diff file).

I've tested this under both wx2.8 and wx3.0.

1 Attachments

Discussion

  • Jason

    Jason - 2016-06-08

    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.

     
  • Jason

    Jason - 2016-06-17

    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
    • Anders

      Anders - 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.

       
      • Jason

        Jason - 2016-06-18

        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).

         
  • Jason

    Jason - 2016-06-18

    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).

     
    • Anders

      Anders - 2016-06-18

      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?

       
      • Jason

        Jason - 2016-06-19

        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
  • Anders

    Anders - 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.

     
    • Jason

      Jason - 2016-06-20

      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 ...'.

       
      • Anders

        Anders - 2016-06-20

        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.

         
        • Jason

          Jason - 2016-06-21

          I just added 'case SUT_UNKOWN:' above 'case SUT_WEB:' to get rid of that warning.

           
  • Anders

    Anders - 2016-06-26
    • status: open --> closed-accepted
     
  • Amir Szekely

    Amir Szekely - 2016-07-09

    I am unable to build on Windows with CustomLinks renamed to Links. I get:

    wxmsw28u_html.lib(htmllib_m_links.obj) : error LNK2005: "public: virtual class wxClassInfo * __thiscall wxHTML_ModuleLinks::GetClassInfo(void)const " (?GetClassInfo@wxHTML_ModuleLinks@@UBEPAVwxClassInfo@@XZ) already defined in nslinks.obj
    wxmsw28u_html.lib(htmllib_m_links.obj) : error LNK2005: "public: static class wxObject * __cdecl wxHTML_ModuleLinks::wxCreateObject(void)" (?wxCreateObject@wxHTML_ModuleLinks@@SAPAVwxObject@@XZ) already defined in nslinks.obj
    wxmsw28u_html.lib(htmllib_m_links.obj) : error LNK2005: "public: static class wxClassInfo  wxHTML_ModuleLinks::ms_classInfo" (?ms_classInfo@wxHTML_ModuleLinks@@2VwxClassInfo@@A) already defined in nslinks.obj
    

    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
    • Jason

      Jason - 2016-07-19

      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.

       
  • Kevin Kofler

    Kevin Kofler - 2017-01-03

    The makensisw link still points nowhere, makensisw is Windows-only.

     

Log in to post a comment.