Announcement

Collapse
No announcement yet.

Compiling NSIS Examples: Can't open output file

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

  • Compiling NSIS Examples: Can't open output file

    All good with NSIS 3.0, except for one thing: for add a Version Information to the installer, now it depends of Resource Hacker to add version information to the installer (or at least, that's the impression that shows in this new tutorial).

    Exist another variables for add or edit version info of the installer without use Resource Hacker?
    Last edited by Anders; 11 October 2016, 03:55. Reason: Not a NSIS 3 specific issue, moved to separate thread

  • #2
    Originally Posted by eliotime3000 View Post
    All good with NSIS 3.0, except for one thing: for add a Version Information to the installer, now it depends of Resource Hacker to add version information to the installer (or at least, that's the impression that shows in this new tutorial).

    Exist another variables for add or edit version info of the installer without use Resource Hacker?
    Did you actually test v3 or are you just wasting everybody's time with pointless questions? If you did test then you forgot to include example code and compiler error messages!

    That wiki page is from 2005, what makes you think anything has changed in v3? In fact, NSIS3 added the !getdllversion instruction that lets you extract information at compile-time with no external tools. v3 still has the same VI* attributes you use to set the version information.
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      Originally Posted by Anders View Post
      Did you actually test v3 or are you just wasting everybody's time with pointless questions? If you did test then you forgot to include example code and compiler error messages!

      That wiki page is from 2005, what makes you think anything has changed in v3? In fact, NSIS3 added the !getdllversion instruction that lets you extract information at compile-time with no external tools. v3 still has the same VI* attributes you use to set the version information.
      I've tested NSIS v3, and the VersionInfo variable that is avariable on the example files is not working.

      Comment


      • #4
        Did you even try !getdllversion?

        Example (NSIS 3):
        Name "get version"
        OutFile "get version.exe"

        RequestExecutionLevel user

        Page instfiles

        !getdllversion "$%windir%\explorer.exe" expv_
        !echo "!echo: Explorer.exe version is ${expv_1}.${expv_2}.${expv_3}.${expv_4}"

        Section one
        MessageBox MB_OK "Explorer.exe version is ${expv_1}.${expv_2}.${expv_3}.${expv_4}"
        SectionEnd
        On my machine this gives: Explorer.exe version is 6.2.14393.206, which is the Windows 10 Anniversary Update version.
        "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
        NSIS 3 POSIX Ninja
        Wiki Profile

        Comment


        • #5
          Originally Posted by JasonFriday13 View Post


          On my machine this gives: Explorer.exe version is 6.2.14393.206, which is the Windows 10 Anniversary Update version.
          Technically not correct, the version should be 10.0.14393.206 but Windows lies even when you try to extract version info from resources these days. Should hopefully not be an issue on files outside %windir%.
          IntOp $PostCount $PostCount + 1

          Comment


          • #6
            Originally Posted by eliotime3000 View Post
            I've tested NSIS v3, and the VersionInfo variable that is avariable on the example files is not working.
            If you believe something is not working then you really should post a small example so we can verify if something is broken or not...
            IntOp $PostCount $PostCount + 1

            Comment


            • #7
              Originally Posted by Anders View Post
              If you believe something is not working then you really should post a small example so we can verify if something is broken or not...
              I'm using the script file named VersionInfo.nsi that is included on NSIS 3.0 final, and the output shows me the following (via HM NIS Edit 2.0.3):

              code:
              Command line:
              "C:\Program Files\NSIS\makensis.exe" /NOTIFYHWND 393820 "C:\Program Files\NSIS\Examples\VersionInfo.nsi"

              Processing config: C:\Program Files\NSIS\nsisconf.nsh
              Processing script file: "C:\Program Files\NSIS\Examples\VersionInfo.nsi" (ACP)

              Processed 1 file, writing output (x86-ansi):

              Output: "C:\Program Files\NSIS\Examples\VersionInfo.exe"
              Can't open output file
              Error - aborting creation process

              I don't understand why the compiling engine does not generate the installer with the VersionInfo variables.

              Comment


              • #8
                I was a bit confused since you started off by linking to something on the wiki and now you are talking about something that ships with NSIS.

                Now that you have posted the compiler output we can finally get somewhere. The compiler is telling you exactly what the problem is:


                Originally Posted by eliotime3000 View Post
                I'm using the script file named VersionInfo.nsi that is included on NSIS 3.0 final, and the output shows me the following (via HM NIS Edit 2.0.3):

                code:
                Output: "C:\Program Files\NSIS\Examples\VersionInfo.exe"
                Can't open output file
                Error - aborting creation process

                This happens if you install NSIS in a directory where you don't have write access.

                You can:

                A) Give everyone write permission to the Examples directory

                or

                B) Copy the .nsi to somewhere you have write access

                or

                C) Copy the code you need and paste it into your own .nsi
                IntOp $PostCount $PostCount + 1

                Comment


                • #9
                  1.- Solved the Issue of the example code. Now i'm trying to solve the problem that I have with the usage of the VersionInfo on my NSI script. The simplest solution was simply skip the following line:

                  code:
                  LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
                  And just paste (and edit) the rest of the script:

                  code:
                  ;Version Information

                  VIProductVersion "1.2.3.4"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Fake company"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"
                  VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"

                  Thanks a lot. And I apologize by claim about NSIS 3.0 release.

                  Comment


                  • #10
                    Originally Posted by eliotime3000 View Post
                    Now i'm trying to solve the problem that I have with the usage of the VersionInfo on my NSI script. The simplest solution was simply skip the following line:

                    code:
                    LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
                    And you failed to post compiler error/warnings again! My guess is that you are using MUI or something else that already loaded the language file. The language file is only loaded in that example so LANG_ENGLISH is defined to the correct language code...
                    IntOp $PostCount $PostCount + 1

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎