Archive: Problems with MUI ...


Problems with MUI ...
Hi, i'm designing a pack for CS. And most of it is already done. But now, i've got into some problems. My installer was free of bugs and now, when i try to compile it, i first get some warnings and when it reaches the part of the icon of the installer, it stops the compilation with the error i'll post below (i'll post the entire compilation log).

------------
rocessing script file: "C:\1_dc\pack\installer\scripts\installer.nsi"
!include: "MUI.nsh"
!include: "C:\ARQUIVOS DE PROGRAMAS\NSIS\Contrib\Modern UI\System.nsh"
NSIS Modern User Interface version 1.67 - © 2002-2003 Joost Verburg (C:\ARQUIVOS DE PROGRAMAS\NSIS\Contrib\Modern UI\System.nsh:11)
!include: closed: "C:\ARQUIVOS DE PROGRAMAS\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\ARQUIVOS DE PROGRAMAS\NSIS\Include\MUI.nsh"
!define: "MUI_PRODUCT"="Jackal Counter-Strike Pack"
!define: "MUI_VERSION"="v1.0 RC2"
!insertmacro: MUI_LANGUAGE
warning: !warning: The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now.
(macro:MUI_INSERT:3)
!insertmacro: end of MUI_LANGUAGE
Function: ".onInit"
InitPluginsDir
File: "splash.bmp"->"$PLUGINSDIR\splash.bmp" [compress] 14854/274806 bytes
File: "splash.wav"->"$PLUGINSDIR\splash.wav" [compress] 19651/31674 bytes
File: "advsplash.dll"->"$PLUGINSDIR\advsplash.dll" [compress] 2665/5120 bytes
Plugin Command: show 1000 600 400 0xFF00FF $PLUGINSDIR\splash
Pop: $0
MessageBox: 4: "Isso irá instalar o Jackal Counter-Strike Pack v1.0 RC2. Deseja prosseguir?" (on IDYES goto NoAbort)
Abort: ""
MessageBox: 0: "Antes será feita uma cópia de segurança de seus arquivos para futura desinstalação."
FunctionEnd
XPStyle: on
CRCCheck: force
overwrite = 0, last_overwrite = 0
SetOverwrite: on
OutFile: "jcp10.exe"
LicenseData: "C:\1_dc\pack\hl\cstrike\licenca.txt"
InstallRegKey: "HKCU\Software\JCP\"
warning: InstallDirRegKey: specified multiple times, wasting space (C:\1_dc\pack\installer\scripts\installer.nsi:34)
InstallRegKey: "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\JCP\UninstallString"
warning: InstallDirRegKey: specified multiple times, wasting space (C:\1_dc\pack\installer\scripts\installer.nsi:35)
InstallRegKey: "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\JCP\DisplayName"
Function: "GetHLPath"
ReadRegStr $1 HKLM\Software\Valve\Half-Life\InstallPath
FunctionEnd
Function: ".onVerifyInstDir"
Call "GetHLPath"
Pop: $1
IfFileExists: "$1\hl.exe" ? PathGood :
Abort: ""
FunctionEnd
!define: "MUI_WELCOMEPAGE"=""
!define: "MUI_LICENSEPAGE"=""
!define: "MUI_COMPONENTSPAGE"=""
!define: "MUI_COMPONENTSPAGE_SMALLDESC"=""
!define: "MUI_FINISHPAGE"=""
!define: "MUI_FINISHPAGE_SHOWREADME"="$1\cstrike\leia-me.txt"
!define: "MUI_FINISHPAGE_NOTCHECKED"=""
!define: "MUI_FINISHPAGE_NOAUTOCLOSE"=""
!define: "MUI_UNINSTALLER"=""
!define: "MUI_ABORTWARNING"=""
!define: "MUI_BRANDINGTEXT"="Jackal Counter-Strike Pack v1.0 RC2 distribuído pelo NSIS v2.0b4"
!define: "MUI_FONT"="Tahoma"
!define: "MUI_FONTSIZE"="8"
!define: "MUI_FONT_HEADER"="Tahoma"
!define: "MUI_FONTSIZE_HEADER"="8"
!define: "MUI_FONT_TITLE"="Tahoma"
!define: "MUI_FONTSIZE_TITLE"="8"
!define: "MUI_INSTALLCOLORS"="/WINDOWS"
!define: "MUI_PROGRESSBAR"="SMOOTH"
!define: "MUI_ICON" already defined!
Error in script "C:\1_dc\pack\installer\scripts\installer.nsi" on line 73 -- aborting creation process
------------

Sorry about the huge post and my full of mistakes english ;)

But i would apreciate if some of you can help me, thanks!


Have you recently updated NSIS? If so then its because MUI has changed some of its commands. See MUI Readme file for info and if you still can't figgure it out attach your script and I'll take a look at it.

Vytautas ;)


Actually, i wrote my script in v2.0b3 and updated to CVS. Then, when it bugged, i installed v2.0b4 ... Should it make any difference?! If yes, where could i find the installer of NSIS v2.0b3 so that i don't need to rewrite the script?


Yes there are quite a few differences between b3 and b4/b5 versions of nsis. As for a link to b3 I think you might be able to get it from the SourceForge CVS, kichik will know for sure. Although the changes should not be too hard to implement and some of the new feature should be worth the upgrade of the scripts.

Vytautas


All previous NSIS 2 versions are available at:

http://sourceforge.net/project/showf...group_id=22049

All previous NSIS 1 versions are available at:

http://www.nullsoft.com/free/nsis/version-history.html

But it is recommened that you update your script and use NSIS 2.0b4.


@Cdzitu:
Had the same problem with the icon. The solution is to place the icon-definition before! any page-definitions:
example:

!define MUI_ICON "MyIcon.ico"
...
!insertmacro MUI_PAGE_WELCOME
...

Regards,
Mæster.


There are more old things in your script

You have to add new page macros and use normal Name and BrandingText commands. These font settings are also not there anymore, the Modern UI always uses the system font now. All interface settings should be set before the pages.

I definately recommend you to upgrade your script. Using old development versions is not a good idea.


InstallRegKey is wrong!!!
it has to be InstallDirRegKey
and u defined it few times. like the compiler sais, it only can be defined one time.


Originally posted by Mæster
@Cdzitu:
Had the same problem with the icon. The solution is to place the icon-definition before! any page-definitions:
example:

!define MUI_ICON "MyIcon.ico"
...
!insertmacro MUI_PAGE_WELCOME
...

Regards,
Mæster.
I also had the same error when I had the MUI_ICON line AFTER these 2
-------------------------------------------------
!define MUI_ABORTWARNING
!insertmacro mui_language "English"
-------------------------------------------------

once I moved before, it all worked


p.s. how do I get the exact version of nsi I'm using, my help/about says only 2.0
nothing about r1 or r2 whatever...

and for the Icon ... you need to define 2. I tried one but it will give a error at the end


!define MUI_ICON "C:\icon.ico"
!define MUI_UNICON "C:\icon.ico"

Originally posted by VegetaSan
and for the Icon ... you need to define 2. I tried one but it will give a error at the end


!define MUI_ICON "C:\icon.ico"
!define MUI_UNICON "C:\icon.ico"
actually i have just the 1 and not the uninstall one and I get no errors. I also have no uninstall parts in my install either