;This is my first script for vb6 application just trying ; 2-02-2006: Dexta ;--------------------------------------- ;Start ; The following two defines are deprecated - just use something like ; !define PRODUCT "ADOShowTotals" ; Name ${PRODUCT} ; and replace all occurrences of ${MUI_FILE} with ${PRODUCT} ; ; Name "ADOTotalsShow" !define MUI_PROUCT "ADO Total Show Beta Ver. 1.0.0" !define MUI_FILE "ADOTotalsShow" !define MUI_VERSION "" !define MUI_BRANDINGTEXT "ADO Total Show Beta Ver. 1.0.0" CRCCheck On !include Library.nsh ; use the alternate include "mui.nsh" ; !include "${NSISDIR}\Contrib\Modern UI\system.nsh" !include "mui.nsh" ;------------------------------------------------- ;General OutFile "ATS Setup.exe" ShowInstDetails "show" ShowUninstDetails "nevershow" SetCompressor "bzip2" !define MUI_ICON "${NSISDIR}\Contrib\Graphics\icons\modern-install-blue.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\icons\modern-uninstall-blue.ico" !define MUI_SPECIALBITMAP "nsis.ico" Var ALREADY_INSTALLED InstallDir "$PROGRAMFILES\${MUI_FILE}" ;--------------------------------------------------------------------- ;UI Configuration ; !define MUI_WELCOMEPAGE ; !define MUI_DIRECTORYPAGE ; !define MUI_ABORTWARNING ; !define MUI_UNINSTALLER ; !define MUI_UNCONFIRMPAGE ; !define MUI_FINISHPAGE ; use the various !defines in the Modern UI to set strings up for use in the dialog pages. ; the pages themselves are done as macros as below. !define MUI_PAGE_ABORTWARNING !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;If you remove this line you will get heaps of warnings about languages strings not being defined. ; basically in fills in any strings that you have defined other values for. !insertmacro MUI_LANGUAGE "English" ; Change to desired language if not English ;--------------------------------------------------------------------- Section "-Install VB6 runtimes" ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the ;application is already installed. For example: SetOutPath "$INSTDIR" IfFileExists "$INSTDIR\${MUI_FILE}.exe" 0 new_installation ;Replace MyApp.exe with your application filename StrCpy $ALREADY_INSTALLED 1 new_installation: file "${MUI_FILE}.exe" file "Parts.mdb" ; !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \ ; "msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR" ; !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR" ; !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR" ; !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR" ; !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR" ; !insertmacro InstallLib TLB $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR" ; !insertmacro InstallLib TLB $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "msado26.tlb" "$SYSDIR\msado26.tlb" "$SYSDIR" ; !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ ; "msdatgrd.ocx" "$SYSDIR\msdatgrd.ocx" "$SYSDIR" ;Create dsktop shortcut ;---------------------------------------------------------------------- CreateShortCut "$DESKTOP\${MUI_FILE}.lnk" "$INSTDIR\${MUI_FILE}.exe" "${MUI_SPECIALBITMAP}" ;create start-menu items CreateDirectory "$SMPROGRAMS\${MUI_FILE}" CreateShortCut "$SMPROGRAMS\${MUI_FILE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "${MUI_UNICON}" "$INSTDIR\Uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\${MUI_FILE}\${MUI_FILE}.lnk" "$INSTDIR\${MUI_FILE}.exe" "${MUI_SPECIALBITMAP}" "$INSTDIR\${MUI_FILE}.exe" 0 ;write uninstall information to the registry WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_FILE}" "DisplayName" "${MUI_FILE} (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_FILE}" "UninstallString" "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd Section "-un.Uninstall VB6 runtimes" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll" !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll" !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb" !insertmacro UninstallLib TLB SHARED NOREMOVE "$SYSDIR\msado26.tlb" !insertmacro UninstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msdatgrd.ocx" ;Delete Files RMDir /r "$INSTDIR\*.*" ;Remove the installation directory RMDir "$INSTDIR" ;Delete Start Menu Shortcuts Delete "$DESKTOP\${MUI_FILE}.lnk" Delete "$SMPROGRAMS\${MUI_FILE}\*.*" RmDir "$SMPROGRAMS\${MUI_FILE}" ;Delete Uninstaller And Unistall Registry Entries DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_FILE}" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_FILE}" SectionEnd