Announcement

Collapse
No announcement yet.

Unicode conversion error 2.4x POSIX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unicode conversion error 2.4x POSIX

    Hi!

    I'm trying to package an old project, which used to work but now suddenly doesn't.
    It seems to have something to do with MUI.

    Heres the error:
    code:

    !insertmacro: MUI_PAGE_WELCOME
    Error while changing UI: Unicode conversion failed
    Error in macro MUI_INTERFACE on macroline 54
    Error in macro MUI_PAGE_INIT on macroline 3
    Error in macro MUI_PAGE_WELCOME on macroline 5

    I've been jumping from one error to the next for the past few days, but am now stuck with this.
    Does anyone have any clue how to solve this?

  • #2
    We need more information.

    Are you changing the default MUI text?

    Windows version? NSIS version?

    Minimal example code?
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      This is the full nsis template script: https://pastebin.com/raw/YUYLvSWM

      > Are you changing the default MUI text?
      Yes, it looks like some texts are being changed.

      > Windows version? NSIS version?
      This is where it gets tricky, im trying to cross-compile for windows on openSUSE. Using NSIS 2.46. I've also tried 3.03 and a whole other sea of errors occured. Im sure this was previosly working on 2.x.

      Is there anything else I can provide that could help?

      Comment


      • #4
        winchar.cpp is the only place in 2.46 that can throw that error AFAIK. ResourceEditor.cpp will probably use it when changing the MUI dialog resource.

        Did you compile all of NSIS on your linux machine? Try to copy the Contrib folder from a Windows install, your UI exe files might be broken somehow.

        You might also want to investigate if iconv on your system is working correctly because NSIS uses that on POSIX when converting to/from Unicode.
        IntOp $PostCount $PostCount + 1

        Comment


        • #5
          > Try to copy the Contrib folder from a Windows install, your UI exe files might be broken somehow.

          This seemed to work. Well, at least I got some new errors associated with some missing libraries. I fixed those errors and I'm now back to a similar error like before:

          code:

          Error adding version information: Unicode conversion failed
          Error - aborting creation process

          Comment


          • #6
            I tested iconv on the machine, it seems to be working (converted a iso-8859-1 file to utf8 successfully)

            Comment


            • #7
              The version information needs to convert the VIAddVersionKey strings. Are those non-ASCII strings?
              IntOp $PostCount $PostCount + 1

              Comment


              • #8
                They should be ASCII.
                Just in case, I tried changing the strings to static values like this:
                code:

                VIProductVersion "1.1.1.1"
                VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "test"
                VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "test"
                VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.1.1.1"

                and the same error still occurs.

                Comment


                • #9
                  Can you test it on Windows?

                  If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow.

                  What is your locale set to?
                  IntOp $PostCount $PostCount + 1

                  Comment


                  • #10
                    Can you test it on Windows?
                    I'm afraid setting that up would take very long, I'd rather avoid it if possible.


                    If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow.
                    I'm getting compilation errors (previously nsis was installed from an rpm) and I'm not confident that I'm compiling it correctly.

                    I'm running this (still NSIS 2.46):
                    code:

                    scons XGCC_W32_PREFIX=i686-w64-mingw32- SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/home/user/client/nsis-2.46-src install-compiler

                    see the errors here
                    (I've added the -libstdc++ flag but to no avail)


                    What is your locale set to?
                    It was set to POSIX, tried setting en_US.UTF-8 and building again but that didn't help.

                    Comment


                    • #11
                      Can you test it on Windows?
                      I'm afraid setting that up would take very long, I'd rather avoid it if possible.


                      If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow.
                      I'm getting compilation errors (previously nsis was installed from an rpm) and I'm not confident that I'm compiling it correctly.

                      I'm running this (still NSIS 2.46):
                      code:

                      scons XGCC_W32_PREFIX=i686-w64-mingw32- SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/home/user/client/nsis-2.46-src install-compiler

                      see the errors here
                      (I've added the -libstdc++ flag but to no avail)


                      What is your locale set to?
                      It was previously set to POSIX, tried building with en_US.UTF-8 but that didn't help.

                      Comment


                      • #12
                        v2.46 is 10 years old so you might have more luck using a environment from that era. Did you try v3.x?
                        IntOp $PostCount $PostCount + 1

                        Comment


                        • #13
                          3.03 also fails
                          code:

                          !undef: "_UAC_ParseDefineFlags_orin_f2" not defined!
                          Error in macro _UAC_ParseDefineFlags_orin on macroline 12
                          Error in macro _UAC_ParseDefineFlags_Begin on macroline 6
                          Error in macro _UAC_ParseDefineFlagsToInt on macroline 1
                          Error in macro UAC_AsUser_Call on macroline 5
                          Error in macro UAC_AsUser_ExecShell on macroline 11
                          Error in script "/root/client/build-win32/_CPack_Packages/unused/NSIS/project.nsi" on line 252 -- aborting creation process

                          Comment


                          • #14
                            Originally Posted by ilmars View Post
                            3.03 also fails
                            That looks like a totally different issue. And it is a 3rd-party deprecated plug-in. Can we maybe focus on makensis itself first?
                            IntOp $PostCount $PostCount + 1

                            Comment


                            • #15
                              After commenting out some (UAC related) lines, v3.03 built the installer successfully. The installer doesn't work correctly though (due to the UAC plugin).

                              I'm guessing that the unicode conversion code has changed since v2.46, or it is being skipped entirely as the strings are already ASCII?

                              I think I'll have to replace the deprecated code and stick with v3.03 because the UAC plugin issue is clear but the v2.46 route would still need further debugging and at this point, I'm expecting another error to show up after that one is fixed. Or, maybe you know a better way?

                              I'm not sure why the UAC plugin was used in the first place. I assume that the installers demand elevated privileges by default, otherwise how would they write to Program Files? My best uneducated guess is that its main purpose is launching the installed installed program (not as admin) after the install has finished and I could certainly do without that.

                              Comment

                              Working...
                              X