Archive: Two Problems...


Two Problems...
  First one is how do i get the discriptions working, i have read the readme/docs...
http://img501.imageshack.us/img501/7533/ssdm4.jpg




Second is how do instead of doing something like...

File "plugin.dll"
File "plugin.exe"
File "plugin.bat"

How can i select a whole folder somthing like...

File "plugin"


1. check the docs for the MUI or the MUI examples coming with NSIS

2. use File /r


So what File /r "plugin" will work?? it comes up error for me... how can i make when it uninstalls to delte that WHOLE folder....???

THe MUI thing didnt work...

 
############################################################################################

!define APP_NAME "D2PK"
!define COMP_NAME "D2PK"
!define WEB_SITE "http://www.d2pk.org"
!define VERSION "10.00.00.00"
!define COPYRIGHT "YourGreatestMember © 2006"
!define DESCRIPTION "D2PK Server Installer"
!define LICENSE_TXT "C:\Program Files\NSIS\Examples\license.rtf"
!define INSTALLER_NAME "C:\Documents and Settings\Ryan\Desktop\Nsisqssg\Output\D2PK Installer\setup.exe"
!define MAIN_APP_EXE "DiabloII.exe"
!define INSTALL_TYPE "SetShellVarContext current"
!define REG_ROOT "HKCU"
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"

!define REG_START_MENU "Start Menu Folder"

var SM_Folder

######################################################################

VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"

######################################################################

SetCompressor ZLIB
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES\"

######################################################################

!include "MUI.nsh"

!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING

!insertmacro MUI_PAGE_WELCOME

!ifdef LICENSE_TXT
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif

!insertmacro MUI_PAGE_COMPONENTS

!insertmacro MUI_PAGE_DIRECTORY

!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "D2PK"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
!endif

!insertmacro MUI_PAGE_INSTFILES

;!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}"
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_CONFIRM

!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "English"


######################################################################
######################################################################


LangString DESC_Section1 ${LANG_ENGLISH} "Description of section 1."
LangString DESC_Section2 ${LANG_ENGLISH} "Description of section 2."
LangString DESC_Section3 ${LANG_ENGLISH} "Description of section 2."

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

######################################################################
######################################################################


######################################################################

Section "!D2PK (required)" Section1

SectionIn RO

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File "DiabloII.exe"
File "binkw32.dll"
File "Bnclient.dll"
File "D2Client.dll"
File "D2CMP.dll"
File "D2Common.dll"
File "D2DDraw.dll"
File "D2Direct3D.dll"
File "D2Game.dll"
File "D2Gdi.dll"
File "D2gfx.dll"
File "D2Glide.dll"
File "D2Lang.dll"
File "D2Launch.dll"
File "D2MCPClient.dll"
File "D2Multi.dll"
File "D2Net.dll"
File "D2sound.dll"
File "D2VidTst.exe"
File "D2Win.dll"
File "Fog.dll"
File "Game.exe"
File "ijl11.dll"
File "Patch_D2.MPQ"
File "SmackW32.dll"
File "Storm.dll"
File "config.bat"
File "D2PKReg.reg"


SectionEnd




; Pickit
Section "Zoids Pickit" Section2

SetOutPath $INSTDIR\plugin

File "choice.com"
File "PreMade Pickits.bat"
File "pick-e.ini"
File "pick-hp.ini"
File "pick-px.ini"
File "pick-pxp.ini"
File "pick-z.ini"
File "readme.txt"
File "runepicket.ini"
File "ygm-pick.ini"
File "zoid.dll"
File "zoid.ini"
File "zpconfig.exe"
File "zpickit.ini"


CreateDirectory "$SMPROGRAMS\$SM_Folder\Pickit"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Pickit\ZPickit.lnk" "$INSTDIR\plugin\zpconfig.exe"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Pickit\PreMade Pickits.lnk" "$INSTDIR\plugin\PreMade Pickits.bat"

SectionEnd
; Pickit End





; CP3o MapHack
Section "C3PO Maphack" Section3

SetOutPath $INSTDIR\C3PO

File "C3PO.CFG"
File "C3PO.exe"
File "r2d2.dll"
File "R2Map.dgl"

CreateDirectory "$SMPROGRAMS\$SM_Folder\C3PO Maphack"
CreateShortCut "$SMPROGRAMS\$SM_Folder\C3PO Maphack\C3PO.lnk" "$INSTDIR\C3PO\C3PO.exe"

SectionEnd



Function .onInstSuccess
Exec config.bat
FunctionEnd


######################################################################

Section -Icons_Reg
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"

!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"

!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!insertmacro MUI_STARTMENU_WRITE_END
!endif

!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\D2PK"
CreateShortCut "$SMPROGRAMS\D2PK\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\D2PK\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"

!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\D2PK\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!endif

WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}"

!ifdef WEB_SITE
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}"
!endif
SectionEnd

######################################################################

Section Uninstall
${INSTALL_TYPE}
Delete "$INSTDIR\${MAIN_APP_EXE}"
Delete "$INSTDIR\binkw32.dll"
Delete "$INSTDIR\Bnclient.dll"
Delete "$INSTDIR\D2Client.dll"
Delete "$INSTDIR\D2CMP.dll"
Delete "$INSTDIR\D2Common.dll"
Delete "$INSTDIR\D2DDraw.dll"
Delete "$INSTDIR\D2Direct3D.dll"
Delete "$INSTDIR\D2Game.dll"
Delete "$INSTDIR\D2Gdi.dll"
Delete "$INSTDIR\D2gfx.dll"
Delete "$INSTDIR\D2Glide.dll"
Delete "$INSTDIR\D2Lang.dll"
Delete "$INSTDIR\D2Launch.dll"
Delete "$INSTDIR\D2MCPClient.dll"
Delete "$INSTDIR\D2Multi.dll"
Delete "$INSTDIR\D2Net.dll"
Delete "$INSTDIR\D2sound.dll"
Delete "$INSTDIR\D2VidTst.exe"
Delete "$INSTDIR\D2Win.dll"
Delete "$INSTDIR\Diablo II.exe"
Delete "$INSTDIR\Fog.dll"
Delete "$INSTDIR\Game.exe"
Delete "$INSTDIR\ijl11.dll"
Delete "$INSTDIR\Patch_D2.mpq"
Delete "$INSTDIR\SmackW32.dll"
Delete "$INSTDIR\Storm.dll"
Delete "$INSTDIR\config.bat"
Delete "$INSTDIR\D2PKReg.reg"

Delete "$INSTDIR\plugin\choice.com"
Delete "$INSTDIR\plugin\PreMade Pickits.bat"
Delete "$INSTDIR\plugin\pick-e.ini"
Delete "$INSTDIR\plugin\pick-hp.ini"
Delete "$INSTDIR\plugin\pick-px.ini"
Delete "$INSTDIR\plugin\pick-pxp.ini"
Delete "$INSTDIR\plugin\pick-z.ini"
Delete "$INSTDIR\plugin\readme.txt"
Delete "$INSTDIR\plugin\runepicket.ini"
Delete "$INSTDIR\plugin\ygm-pick.ini"
Delete "$INSTDIR\plugin\zoid.dll"
Delete "$INSTDIR\plugin\zoid.ini"
Delete "$INSTDIR\plugin\zpconfig.exe"
Delete "$INSTDIR\plugin\zpickit.ini"


Delete "$INSTDIR\C3PO\C3PO.CFG"
Delete "$INSTDIR\C3PO\C3PO.exe"
Delete "$INSTDIR\C3PO\r2d2.dll"
Delete "$INSTDIR\C3PO\R2Map.dgl"


RmDir "$INSTDIR\plugin"
RmDir "$INSTDIR\C3PO"

Delete "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
Delete "$INSTDIR\${APP_NAME} website.url"
!endif

RmDir "$INSTDIR"

!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Pickit\ZPickit.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Pickit\PreMade Pickits.lnk"
Delete "$SMPROGRAMS\$SM_Folder\C3PO Maphack\C3PO.lnk"

!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
!endif
Delete "$DESKTOP\${APP_NAME}.lnk"


; Remove shortcuts, if any
Delete "$SMPROGRAMS\D2PK\Pickit"
Delete "$SMPROGRAMS\D2PK\Pickit*.*"

Delete "$SMPROGRAMS\D2PK\C3PO Maphack"
Delete "$SMPROGRAMS\D2PK\C3PO Maphack*.*"
Delete "$SMPROGRAMS\D2PK"
Delete "$SMPROGRAMS\D2PK\*.*"
Delete "$INSTDIR\plugin*.*"
Delete "$INSTDIR\C3PO*.*"
Delete "$INSTDIR\*.*"


; Remove directories used
RMDir "$SMPROGRAMS\D2PK\Pickit"
RMDir "$SMPROGRAMS\D2PK\Pickit*.*"
RMDir "$SMPROGRAMS\D2PK\C3PO Maphack"
RMDir "$SMPROGRAMS\D2PK\C3PO Maphack*.*"
RMDir "$SMPROGRAMS\D2PK"
RMDir "$SMPROGRAMS\D2PK\*.*"
RMDir "$INSTDIR\plugin"
RMDir "$INSTDIR\C3PO Maphack"
RMDir "$INSTDIR"

RmDir "$SMPROGRAMS\$SM_Folder\C3PO Maphack"
RmDir "$SMPROGRAMS\$SM_Folder\pickit"
RmDir "$SMPROGRAMS\$SM_Folder"
!endif

!ifndef REG_START_MENU
Delete "$SMPROGRAMS\D2PK\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\D2PK\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\D2PK\${APP_NAME} Website.lnk"
!endif
Delete "$DESKTOP\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Pickit\ZPickit.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Pickit\PreMade Pickits.lnk"
Delete "$SMPROGRAMS\$SM_Folder\C3PO Maphack\C3PO.lnk"

RmDir "$SMPROGRAMS\D2PK"
RmDir "$SMPROGRAMS\D2PK\plugin"
RmDir "$SMPROGRAMS\$SM_Folder\plugin"
RmDir "$SMPROGRAMS\D2PK\C3PO Maphack"
RmDir "$SMPROGRAMS\$SM_Folder\C3PO Maphack"
RmDir "$SMPROGRAMS\$SM_Folder"
!endif

DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
SectionEnd

######################################################################


Please attach large scripts in the future...

File is not a plugin; it's a basic script instruction.

In your case, you could use File /r *.*. (This assumes that your files are in the same folder as your install script; if not, you'll need to specify the path along with the wild card (IE File /r "C:\YourPath\*.*").

If you you need to remove the files using a similiar process, then you can use RMDir /r. And if you need, you can specify the /REBOOTOK switch to allow in-use files to be deleted on the next reboot.

The /r switch should be used with caution (for example if the user just picks the root of "Program Files" to install to, you wouldn't want to remove the entire directory as it would pretty much destroy the user's other installed programs!)


How do i change the icon all the manual gives me is:

4.8.1.18 Icon
[path\]icon.ico
Sets the icon of the installer. Every icon in the icon file will be included in the installer. Note that if you use an uninstaller, each icon in the icon file must have the same size and color depth as its matching icon in the uninstaller icon file. The order of the icons in the icon file also matters. For example, if the installer icon file has three icons, first icon sized 32x32 pixels with 8bpp, second icon sized 16x16 pixels with 8bpp and third icon sized 8x8 with 8bpp; then the uninstaller icon file must have three icons with the same sizes and color depths, in the same order. Use UninstallIcon to set the uninstaller icon.


That doesnt help how do i start the icon sentence..


MUI_COMPONENTSPAGE_NODES

Doesnt work.... and the changing of the discripption on the components page doesnt work...


Do it just like it says:


Icon "c:\path\icon.ico"


Have a look in your NSIS install directory for more examples of this and other NSIS commands.

and the changing of the discripption on the components page doesnt work...
Did you see the 3 warnings your script generates?
3 warnings:

unknown variable/constant "{Section1}" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:5)
unknown variable/constant "{Section2}" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:5)
unknown variable/constant "{Section3}" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:5)
That's why your descriptions don't work. Move the lines from MUI_FUNCTION_DESCRIPTION_BEGIN to MUI_FUNCTION_DESCRIPTION_END after the sections to fix that. After that they will work (although two of your descriptions have the same text: 'Description of section 2.').

The section identifiers are defined when the script compiler processes the Section keyword. You were trying to use defined values before they were defined.

Don

You should use MUI_ICON to set the icon with Modern UI.

Stu