- NSIS Discussion
- Error when trying to compile
Archive: Error when trying to compile
Biasoli
27th September 2007 22:06 UTC
Error when trying to compile
Hi.
I'm new to the program and i have an error when trying to compile my nsi:
Error: resolving install function "Nsis2Io" in function "mui.WelcomePre_26.5.9"
I'm using the Modern UI in it.
Any idea of why im getting this?
Afrow UK
27th September 2007 22:38 UTC
You must have a call to Nsis2Io in your code - which doesn't exist? There isn't any references in MUI.nsh or MUI2.nsh.
Stu
Biasoli
28th September 2007 01:53 UTC
I'm using the MUI.nsh.
I've searched in the System.nsh file and i founded this:
http://img379.imageshack.us/img379/9237/errorgr1.jpg
It says something about an uninstaller.
Biasoli
28th September 2007 07:04 UTC
Well, i have decided not to use MUI.
Now my installer is running well.
But i still having a problem.
I want to add a file to the installer, to use it later (at the end of the installation).
I've tried using ReserveFile "name.exe" at the begining of the script, and later use Exec "name.exe" on the .onInstSucces function.
This works if the file exists in the nsi folder.
Then i tried removing the exe from the folder, and it did not work.
Any idea of how to do this?
kichik
28th September 2007 09:33 UTC
ReserveFile doesn't actually extract but only adds the file to the compressed block. Use File instead.
kichik
28th September 2007 19:50 UTC
I can't reproduce your original issue. Can you attach a script that demonstrates this?
Biasoli
28th September 2007 22:54 UTC
Sure, here i wrote a script:
Name "Test"
InstallDir "C:\TestFolder\"
OutFile "Test.exe"
ReserveFile "name.exe" ; <--------------------
Page components
Page directory
Page instfiles
Function .onInstSuccess
Exec "name.exe" ; <--------------------
FunctionEnd
Section "Message"
MessageBox MB_ICONINFORMATION "Test Message"
SectionEnd
Just try doing it.
I won't work if the file "name.exe" doesn't exists until the run-time.
kichik
28th September 2007 23:35 UTC
That's because ReserveFile doesn't actually extract. You must use File for that.
But I wasn't asking about that, I was referring to the original problem for which you opened this thread.
Biasoli
29th September 2007 00:49 UTC
But I wasn't asking about that, I was referring to the original problem for which you opened this thread.
I modified my script.
But i'm sure is something about Modern UI.
That's because ReserveFile doesn't actually extract. You must use File for that.
You did not understand me.
This is what i want to do:
1)Put/add a file to the installer.
2)At the end of the instalation, execute that file that is INSIDE of the installer.
I want to attach a file to installer and later use it.
Can i do that?
kichik
29th September 2007 00:57 UTC
You have to extract the file in order to execute it. You can't execute it from inside the installer. To extract it, use File.
Biasoli
29th September 2007 01:23 UTC
Great, that works.
I used File "name.exe" to extract it, then i used ExecWait "name.exe" and then Delete "$INSTDIR\name.exe".
It works well.
Thank you very much.
Biasoli
29th September 2007 02:58 UTC
Now i have another doubt.
I have readed somes scripts but i still can't understand how to change the description of a section.
How can i do this?
Joel
29th September 2007 03:41 UTC
In runtime?
See Docs.
Biasoli
29th September 2007 03:55 UTC
That's one of the scripts i've readed.
In fact, i did not understand it at all.
Can someone explain me the script?
kichik
29th September 2007 10:09 UTC
That's a hard task when not using the MUI and requires knowledge of Win32 API. Without using the MUI, you don't even have a place to put the descriptions.
In short:
- Create a UI with a label to display the descriptions by editing Contrib\UIs\default.exe with Resource Hacker.
- In .onMouseOverSection, get a HWND of that label.
- Set the appropriate text of that label by sending WM_SETTEXT with SendMessage.
Biasoli
29th September 2007 21:24 UTC
I'm gonna try to do it, but i'll have to read a lot.
Thanks again.
MSG
29th November 2007 11:55 UTC
Re: Error when trying to compile
Originally posted by Biasoli
Error: resolving install function "Nsis2Io" in function "mui.WelcomePre_26.5.9"
I just had the same problem. It occured when I remmed the line
!insertmacro MUI_LANGUAGE "CustomLanguagefile1"
Enabling the line back again solved it. Disabling the Finish page also solved it.
It's got to have something to do with cross-version format changes of the language files, but I don't understand why it would give errors if I remove the entire line. After all, it should just use the default language then, right? And that should always work with the currently installed version of NSIS, right? (Unless the installer failed to overwrite it, but I have no reason to assume that.)
Edit: Note that my CustomLanguagefile1 was a copy from the *new* English languagefile, with one line edited. So it should be 100% new-version-compatible.
kichik
29th November 2007 17:15 UTC
I don't understand what you've done to get this error. Please attach an example script.
galevsky
29th November 2007 17:38 UTC
I know why.... you have to insert your MUI_PAGES BEFORE including the MUI_LANGUAGE ...
If you run MUI_LANGUAGE before the MUI_PAGES => error to resolve Nsis2Io..
Gal'
MSG
29th November 2007 21:00 UTC
That's strange, because kichik just told me in the channel that it needs to go AFTER the page declarations.
Either way, the problem occured for me when I disabled the language define, which is of course the very point - MUI doesn't default to a language, it needs the define. So pebkac, once again.
galevsky
29th November 2007 21:12 UTC
? you didn't understand what I wrote ?
you have to insert your MUI_PAGES BEFORE including the MUI_LANGUAGE ...
That's strange, because kichik just told me in the channel that it needs to go AFTER the page declarations.
It is the same thing.... MUI_PAGES come first then MUI_LANGUAGE and LangString.
And do not skip MUI_LANGUAGE declaration !!!
Following code is right:
!include "MUI.nsh"
Name "Modern UI Test"
OutFile test.exe
XPStyle on
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Dutch"
LangString msg ${LANG_ENGLISH} "English msg"
LangString msg ${LANG_DUTCH} "Dutch msg"
function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
functionEnd
section "Silent" SILENT_SEC
MessageBox MB_OK "$(msg)" ; $() instead of ${}
sectionEnd
Following code generates Nsis2io error:
!include "MUI.nsh"
Name "Modern UI Test"
OutFile test.exe
XPStyle on
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
LangString msg ${LANG_ENGLISH} "English msg"
LangString msg ${LANG_DUTCH} "Dutch msg"
function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
functionEnd
section "Silent" SILENT_SEC
MessageBox MB_OK "$(msg)" ; $() instead of ${}
sectionEnd
Gal'