Archive: newbie question


newbie question
  1. this is my first try with nsis so please keep your answers simple^^

everytime i try to use "!insertmacro MUI_PAGE_INSTFILES" i get an errormessage while compiling
if i put a ";" before it compiling works fine

here is my script

SetCompressor  lzma
Var hmci
!include g2mod.nsh

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "install\System\Namenlos.ico"
!define MUI_UNICON "install\System\Namenlos.ico"

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "licence.rtf"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\System\GothicStarter.exe"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "German"

; MUI end ------





;--------------------------------
Name "Die Schöpfung"
OutFile "DieSchoepfung.exe"
InstallDir "$PROGRAMFILES\JoWooD\Gothic II\"
;LicenseData "licence.rtf"
;LicenseBkColor 0xFFFFFF

;Insttype "Komplett"
;Insttype "Minimal"


;Page license
;Page components
;Page directory
;Page instfiles
;UninstPage uninstConfirm
;UninstPage instfiles


Function .onInit


;--------------------------------
; $INSTDIR bereits gültig?
IfFileExists "$INSTDIR\System\Gothic2.exe" done

; Sonst Add-ON Installation suchen (Registrierung)
Call g2mod_GetInstallLocation
Pop $R0
StrCmp $R0 "" done
; Ãœbernehmen
StrCpy $INSTDIR $R0

done:
Pop $R0
;--------------------------------


InitPluginsDir
SetOutPath $PLUGINSDIR
File "Installer_loop.mp3"
System::Call 'msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\Installer_loop.mp3") i .r0'
StrCpy $hmci $0
SendMessage $hmci 0x0490 0 0 $0
IntCmp $0 0 nosup
ShowWindow $hmci SW_HIDE
SendMessage $hmci 0x0465 0 "STR:play repeat"
nosup:
;--------------------------------
;User defined skin
SetOutPath $TEMP
File /oname=ds-style.skf "ds-style.skf"
NSIS_SkinCrafter_Plugin::skin /NOUNLOAD $TEMP\ds-style.skf
;Delete $TEMP\ds-style.skf
FunctionEnd
;--------------------------------

Function .onGUIEnd
NSIS_SkinCrafter_Plugin::destroy
FunctionEnd
;--------------------------------

Function un.onGUIEnd
NSIS_SkinCrafter_Plugin::destroy
FunctionEnd









Section "Schöpfung Mod" main
SectionIn RO

;Icon und INI in System kopieren
SetOutPath "$INSTDIR\System"
File ".\install\System\schoepfung.ini"
File ".\install\System\Namenlos.ico"

;.mod in modvdf kopieren
SetOutPath "$INSTDIR\Data\modvdf"
File ".\install\Data\modvdf\schoepfung.mod"

;gothic starter kopieren
SetOutPath "$INSTDIR\System"
File ".\install\System\GothicStarter.exe"
File ".\install\System\GothicGame.ini"

;Uninstaller
WriteUninstaller "$INSTDIR\DS-Uninstall.exe"

;Save Ordner
CreateDirectory "$INSTDIR\saves_schoepfung\current"
SectionEnd


Section "Speech" speech
;blubbb
SectionEnd



Section "Shortcuts" links
CreateShortCut "$DESKTOP\Die Schöpfung.lnk" "$INSTDIR\System\GothicStarter.exe" "" "$INSTDIR\System\Namenlos.ico" 0
SectionEnd





;Component Descriptions
LangString DESC_main ${LANG_GERMAN} "Grunddateien der Mod Die Schöpfung"
LangString DESC_speech ${LANG_GERMAN} "Synchronisation der Dialoge"
LangString DESC_links ${LANG_GERMAN} "Verknüpfung auf dem Desktop und im Startmenü"

LangString DESC_haupt ${LANG_ENGLISH} "base files of the mod"
LangString DESC_speech ${LANG_ENGLISH} "audio files for the dialogs"
LangString DESC_links ${LANG_ENGLISH} "shortcuts on the desktop and in the starup menue"

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${main} $(DESC_main)
!insertmacro MUI_DESCRIPTION_TEXT ${speech} $(DESC_speech)
!insertmacro MUI_DESCRIPTION_TEXT ${links} $(DESC_links)
!insertmacro MUI_FUNCTION_DESCRIPTION_END





Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "Die Schöpfung wurde erfolgreich deinstalliert."
FunctionEnd

Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie Die Schöpfung deinstallieren?" IDYES +2
Abort
NSIS_SkinCrafter_Plugin::skin /NOUNLOAD $TEMP\ds-style.skf
FunctionEnd

Section "Uninstall"

Delete "$INSTDIR\System\schoepfung.ini"
Delete "$INSTDIR\System\Namenlos.ico"
Delete "$INSTDIR\Data\modvdf\schoepfung.mod"
Delete "$INSTDIR\DS-Uninstall.exe"

RMDir "$INSTDIR\saves_schoepfung\current"
RMDir "$INSTDIR\saves_schoepfung"
RMDir /r "$INSTDIR\Data\modvdf"
Delete "$DESKTOP\Die Schöpfung.lnk"
SectionEnd



and sorry for the bad english :D

What's the error?


http://bildupload.sro.at/a/images/3-error.jpg


!define MUI_LANGDLL_REGISTRY_ROOT can't have quotes, only HKLM or HKCU or a define that resolves to one of those


thx but the error with !insertmacro MUI_PAGE_INSTFILES is still there


nobody an idea
i thougt copying files is a real basic thing :D


What are your values for PRODUCT_UNINST_ROOT_KEY and PRODUCT_UNINST_KEY?

Stu


there are none :D
i copyed it from some demo code^^
as i said i just started with nsis


well, you need to define them, or remove:
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"


thx
now everything works fine :)

one last question:
is it possible to display a big window in the back while installing whre some pictures can be shown like in many professional setups?


There is a Plugin which allows you to display background images (use of Option BANNER )
NewAdvSlpash

To get a Background Window you can use the option
BGGradient

I don't know how this two features works together, so you have to try it on your one.

nobs


In my opinion, these installers with a full-screen background are kinda old-school and don't look professional nowadays...

if you still want it, take a look at the BgImage plug-in that comes with NSIS


i think the bgimage plugin is what i was looking for :)
but in the text here was said not to use the SetBg command in the oninit function
where else? i want the window to open at the beginning
(i tried it anyway and as expected it didnt work :D )

next question is it possible to change the image after a few seconds

edit:

now i added following lines to the script


onGUIInit

InitPluginsDir
SetOutPath $PLUGINSDIR
File "background.bmp"
BgImage::setBg /NOUNLOAD /FILLSCREEN "$PLUGINSDIR\background.bmp"
BgImage::Redraw /NOUNLOAD
FunctionEnd
>
but the compiler always say the Function .onGUIInit already exits
but in the whole script this is the only function named .onGUIInit

the MUI already uses that function, read the MUI docs and figure out the right MUI_* define to use


the bgimage works thx
but what about changing the image after a period of time?


You'd need to write a plug-in to run asynchronously to do it.

Stu


ok
then i am happy with changing it the traditional way :D