version 1.1, 2012/02/21 16:32:16
|
version 1.1.1.3, 2013/07/22 01:17:36
|
Line 3
|
Line 3
|
; |
; |
; Home page of code is: http://smartmontools.sourceforge.net |
; Home page of code is: http://smartmontools.sourceforge.net |
; |
; |
; Copyright (C) 2006-11 Christian Franke <smartmontools-support@lists.sourceforge.net> | ; Copyright (C) 2006-13 Christian Franke <smartmontools-support@lists.sourceforge.net> |
; |
; |
; This program is free software; you can redistribute it and/or modify |
; This program is free software; you can redistribute it and/or modify |
; it under the terms of the GNU General Public License as published by |
; it under the terms of the GNU General Public License as published by |
Line 19
|
Line 19
|
|
|
;-------------------------------------------------------------------- |
;-------------------------------------------------------------------- |
; Command line arguments: |
; Command line arguments: |
; makensis -DINPDIR=<input-dir> -DOUTFILE=<output-file> -DVERSTR=<version-string> installer.nsi | ; makensis -DINPDIR=<input-dir> -DINPDIR64=<input-dir-64-bit> \ |
| ; -DOUTFILE=<output-file> -DVERSTR=<version-string> installer.nsi |
|
|
!ifndef INPDIR |
!ifndef INPDIR |
!define INPDIR "." |
!define INPDIR "." |
Line 40 SetCompressor /solid lzma
|
Line 41 SetCompressor /solid lzma
|
XPStyle on |
XPStyle on |
InstallColors /windows |
InstallColors /windows |
|
|
InstallDir "$PROGRAMFILES\smartmontools" | ; Set in .onInit |
InstallDirRegKey HKLM "Software\smartmontools" "Install_Dir" | ;InstallDir "$PROGRAMFILES\smartmontools" |
| ;InstallDirRegKey HKLM "Software\smartmontools" "Install_Dir" |
|
|
Var EDITOR |
Var EDITOR |
Var UBCDDIR |
|
|
|
|
!ifdef INPDIR64 |
|
Var X64 |
|
Var INSTDIR32 |
|
Var INSTDIR64 |
|
!endif |
|
|
LicenseData "${INPDIR}\doc\COPYING.txt" |
LicenseData "${INPDIR}\doc\COPYING.txt" |
|
|
!include "FileFunc.nsh" |
!include "FileFunc.nsh" |
Line 61 RequestExecutionLevel admin
|
Line 68 RequestExecutionLevel admin
|
|
|
Page license |
Page license |
Page components |
Page components |
Page directory SkipProgPath "" "" | !ifdef INPDIR64 |
PageEx directory | Page directory CheckX64 |
PageCallbacks SkipUBCDPath "" "" | !else |
DirText "Setup will install the UBCD4Win plugin in the following folder." | Page directory |
DirVar $UBCDDIR | !endif |
PageExEnd | |
Page instfiles |
Page instfiles |
|
|
UninstPage uninstConfirm |
UninstPage uninstConfirm |
Line 75 UninstPage instfiles
|
Line 81 UninstPage instfiles
|
InstType "Full" |
InstType "Full" |
InstType "Extract files only" |
InstType "Extract files only" |
InstType "Drive menu" |
InstType "Drive menu" |
InstType "UBCD4Win plugin" |
|
|
|
|
|
;-------------------------------------------------------------------- |
;-------------------------------------------------------------------- |
; Sections |
; Sections |
|
|
|
!ifdef INPDIR64 |
|
Section "64-bit version" X64_SECTION |
|
; Handled in Function CheckX64 |
|
SectionEnd |
|
!endif |
|
|
SectionGroup "!Program files" |
SectionGroup "!Program files" |
|
|
|
!macro FileExe path option |
|
!ifdef INPDIR64 |
|
; Use dummy SetOutPath to control archive location of executables |
|
StrCmp $X64 "" +5 |
|
Goto +2 |
|
SetOutPath "$INSTDIR\bin64" |
|
File ${option} '${INPDIR64}\${path}' |
|
GoTo +4 |
|
Goto +2 |
|
SetOutPath "$INSTDIR\bin" |
|
File ${option} '${INPDIR}\${path}' |
|
!else |
|
File ${option} '${INPDIR}\${path}' |
|
!endif |
|
!macroend |
|
|
Section "smartctl" SMARTCTL_SECTION |
Section "smartctl" SMARTCTL_SECTION |
|
|
SectionIn 1 2 |
SectionIn 1 2 |
|
|
SetOutPath "$INSTDIR\bin" |
SetOutPath "$INSTDIR\bin" |
File "${INPDIR}\bin\smartctl.exe" | !insertmacro FileExe "bin\smartctl.exe" "" |
|
|
SectionEnd |
SectionEnd |
|
|
Line 105 SectionGroup "!Program files"
|
Line 132 SectionGroup "!Program files"
|
StrCmp $0 "" nosrv |
StrCmp $0 "" nosrv |
ExecWait "net stop smartd" $1 |
ExecWait "net stop smartd" $1 |
nosrv: |
nosrv: |
File "${INPDIR}\bin\smartd.exe" | !insertmacro FileExe "bin\smartd.exe" "" |
|
|
IfFileExists "$INSTDIR\bin\smartd.conf" 0 +2 |
IfFileExists "$INSTDIR\bin\smartd.conf" 0 +2 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Replace existing configuration file$\n$INSTDIR\bin\smartd.conf ?" IDYES 0 IDNO +2 | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Replace existing configuration file$\n$INSTDIR\bin\smartd.conf ?" /SD IDNO IDYES 0 IDNO +2 |
File "${INPDIR}\doc\smartd.conf" |
File "${INPDIR}\doc\smartd.conf" |
|
|
IfFileExists "$WINDIR\system32\cmd.exe" 0 +2 | File "${INPDIR}\bin\smartd_warning.cmd" |
File /nonfatal "${INPDIR}\bin\syslogevt.exe" | !insertmacro FileExe "bin\wtssendmsg.exe" "" |
|
|
; Restart service ? |
; Restart service ? |
StrCmp $1 "0" 0 +3 |
StrCmp $1 "0" 0 +3 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Restart smartd service ?" IDYES 0 IDNO +2 | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Restart smartd service ?" /SD IDNO IDYES 0 IDNO +2 |
ExecWait "net start smartd" |
ExecWait "net start smartd" |
|
|
SectionEnd |
SectionEnd |
Line 126 SectionGroup "!Program files"
|
Line 153 SectionGroup "!Program files"
|
SectionIn 1 2 |
SectionIn 1 2 |
|
|
SetOutPath "$INSTDIR\bin" |
SetOutPath "$INSTDIR\bin" |
File "${INPDIR}\bin\smartctl-nc.exe" | !insertmacro FileExe "bin\smartctl-nc.exe" "" |
|
|
SectionEnd |
SectionEnd |
|
|
Line 148 Section "!Documentation" DOC_SECTION
|
Line 175 Section "!Documentation" DOC_SECTION
|
|
|
SetOutPath "$INSTDIR\doc" |
SetOutPath "$INSTDIR\doc" |
File "${INPDIR}\doc\AUTHORS.txt" |
File "${INPDIR}\doc\AUTHORS.txt" |
File "${INPDIR}\doc\CHANGELOG.txt" | File "${INPDIR}\doc\ChangeLog.txt" |
| File "${INPDIR}\doc\ChangeLog-5.0-6.0.txt" |
File "${INPDIR}\doc\COPYING.txt" |
File "${INPDIR}\doc\COPYING.txt" |
File "${INPDIR}\doc\INSTALL.txt" |
File "${INPDIR}\doc\INSTALL.txt" |
File "${INPDIR}\doc\NEWS.txt" |
File "${INPDIR}\doc\NEWS.txt" |
File "${INPDIR}\doc\README.txt" |
File "${INPDIR}\doc\README.txt" |
File "${INPDIR}\doc\TODO.txt" |
File "${INPDIR}\doc\TODO.txt" |
File "${INPDIR}\doc\WARNINGS.txt" |
File "${INPDIR}\doc\WARNINGS.txt" |
File "${INPDIR}\doc\checksums.txt" | !ifdef INPDIR64 |
| StrCmp $X64 "" +3 |
| File "${INPDIR64}\doc\checksums64.txt" |
| GoTo +2 |
| File "${INPDIR}\doc\checksums32.txt" |
| !else |
| File "${INPDIR}\doc\checksums??.txt" |
| !endif |
File "${INPDIR}\doc\smartctl.8.html" |
File "${INPDIR}\doc\smartctl.8.html" |
File "${INPDIR}\doc\smartctl.8.txt" |
File "${INPDIR}\doc\smartctl.8.txt" |
File "${INPDIR}\doc\smartd.8.html" |
File "${INPDIR}\doc\smartd.8.html" |
Line 169 SectionEnd
|
Line 204 SectionEnd
|
Section "Uninstaller" UNINST_SECTION |
Section "Uninstaller" UNINST_SECTION |
|
|
SectionIn 1 |
SectionIn 1 |
AddSize 35 | AddSize 40 |
|
|
CreateDirectory "$INSTDIR" |
CreateDirectory "$INSTDIR" |
|
|
Line 209 Section "Start Menu Shortcuts" MENU_SECTION
|
Line 244 Section "Start Menu Shortcuts" MENU_SECTION
|
|
|
; runcmdu |
; runcmdu |
IfFileExists "$INSTDIR\bin\smartctl.exe" 0 +2 |
IfFileExists "$INSTDIR\bin\smartctl.exe" 0 +2 |
IfFileExists "$INSTDIR\bin\smartd.exe" 0 +4 | IfFileExists "$INSTDIR\bin\smartd.exe" 0 noruncmd |
SetOutPath "$INSTDIR\bin" |
SetOutPath "$INSTDIR\bin" |
File "${INPDIR}\bin\runcmdu.exe" | !insertmacro FileExe "bin\runcmdu.exe" "" |
File "${INPDIR}\bin\runcmdu.exe.manifest" |
File "${INPDIR}\bin\runcmdu.exe.manifest" |
|
noruncmd: |
|
|
; smartctl |
; smartctl |
IfFileExists "$INSTDIR\bin\smartctl.exe" 0 noctl |
IfFileExists "$INSTDIR\bin\smartctl.exe" 0 noctl |
SetOutPath "$INSTDIR\bin" |
SetOutPath "$INSTDIR\bin" |
IfFileExists "$WINDIR\system32\cmd.exe" 0 nocmd | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl (Admin CMD).lnk" "$WINDIR\system32\cmd.exe" '/k PATH=$INSTDIR\bin;%PATH%&cd /d "$INSTDIR\bin"' |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl (Admin CMD).lnk" "$WINDIR\system32\cmd.exe" '/k PATH=$INSTDIR\bin;%PATH%&cd /d "$INSTDIR\bin"' | |
nocmd: | |
CreateDirectory "$SMPROGRAMS\smartmontools\smartctl Examples" |
CreateDirectory "$SMPROGRAMS\smartmontools\smartctl Examples" |
FileOpen $0 "$SMPROGRAMS\smartmontools\smartctl Examples\!Read this first!.txt" "w" |
FileOpen $0 "$SMPROGRAMS\smartmontools\smartctl Examples\!Read this first!.txt" "w" |
FileWrite $0 "All the example commands in this directory$\r$\napply to the first drive (sda).$\r$\n" |
FileWrite $0 "All the example commands in this directory$\r$\napply to the first drive (sda).$\r$\n" |
FileClose $0 |
FileClose $0 |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\All info (-a).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -a sda" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\All info (-x).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -x sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\Identify drive (-i).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -i sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\Identify drive (-i).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -i sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART attributes (-A).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -A sda" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART attributes (-A -f brief).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -A -f brief sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART capabilities (-c).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -c sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART capabilities (-c).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -c sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART health status (-H).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -H sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART health status (-H).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -H sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART error log (-l error).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -l error sda" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART error log (-l error).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -l error sda" |
Line 252 Section "Start Menu Shortcuts" MENU_SECTION
|
Line 286 Section "Start Menu Shortcuts" MENU_SECTION
|
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.conf" |
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.conf" |
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.log (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.log" |
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.log (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.log" |
|
|
; smartd service (not on 9x/ME) | ; smartd service |
IfFileExists "$WINDIR\system32\cmd.exe" 0 nosvc | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, eventlog, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, eventlog, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 10min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0 -i 600" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 10min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0 -i 600" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service remove.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd remove" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service remove.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd remove" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service start.lnk" "$INSTDIR\bin\runcmdu.exe" "net start smartd" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service start.lnk" "$INSTDIR\bin\runcmdu.exe" "net start smartd" | !insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service stop.lnk" "$INSTDIR\bin\runcmdu.exe" "net stop smartd" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service stop.lnk" "$INSTDIR\bin\runcmdu.exe" "net stop smartd" | |
nosvc: | |
nod: |
nod: |
|
|
; Documentation |
; Documentation |
Line 278 Section "Start Menu Shortcuts" MENU_SECTION
|
Line 310 Section "Start Menu Shortcuts" MENU_SECTION
|
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb.h (view).lnk" "$EDITOR" "$INSTDIR\bin\drivedb.h" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb.h (view).lnk" "$EDITOR" "$INSTDIR\bin\drivedb.h" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb-add.h (create, edit).lnk" "$EDITOR" "$INSTDIR\bin\drivedb-add.h" |
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb-add.h (create, edit).lnk" "$EDITOR" "$INSTDIR\bin\drivedb-add.h" |
nodb: |
nodb: |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\AUTHORS.lnk" "$INSTDIR\doc\AUTHORS.txt" | CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\ChangeLog.lnk" "$INSTDIR\doc\ChangeLog.txt" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\CHANGELOG.lnk" "$INSTDIR\doc\CHANGELOG.txt" | |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\COPYING.lnk" "$INSTDIR\doc\COPYING.txt" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\COPYING.lnk" "$INSTDIR\doc\COPYING.txt" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\INSTALL.lnk" "$INSTDIR\doc\INSTALL.txt" |
|
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\NEWS.lnk" "$INSTDIR\doc\NEWS.txt" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\NEWS.lnk" "$INSTDIR\doc\NEWS.txt" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\README.lnk" "$INSTDIR\doc\README.txt" |
|
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\TODO.lnk" "$INSTDIR\doc\TODO.txt" |
|
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\WARNINGS.lnk" "$INSTDIR\doc\WARNINGS.txt" |
|
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\Windows version download page.lnk" "http://smartmontools-win32.dyndns.org/smartmontools/" |
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\Windows version download page.lnk" "http://smartmontools-win32.dyndns.org/smartmontools/" |
nodoc: |
nodoc: |
|
|
Line 310 Section "Add install dir to PATH" PATH_SECTION
|
Line 337 Section "Add install dir to PATH" PATH_SECTION
|
|
|
SectionIn 1 |
SectionIn 1 |
|
|
IfFileExists "$WINDIR\system32\cmd.exe" 0 +3 | Push "$INSTDIR\bin" |
Push "$INSTDIR\bin" | Call AddToPath |
Call AddToPath | |
|
|
SectionEnd |
SectionEnd |
|
|
Line 343 SectionGroup "Add smartctl to drive menu"
|
Line 369 SectionGroup "Add smartctl to drive menu"
|
SectionEnd |
SectionEnd |
!macroend |
!macroend |
|
|
!insertmacro DriveSection 0 "SMART all info" "-a" | !insertmacro DriveSection 0 "SMART all info" "-x" |
!insertmacro DriveSection 1 "SMART status" "-Hc" |
!insertmacro DriveSection 1 "SMART status" "-Hc" |
!insertmacro DriveSection 2 "SMART attributes" "-A" | !insertmacro DriveSection 2 "SMART attributes" "-A -f brief" |
!insertmacro DriveSection 3 "SMART short selftest" "-t short" |
!insertmacro DriveSection 3 "SMART short selftest" "-t short" |
!insertmacro DriveSection 4 "SMART long selftest" "-t long" |
!insertmacro DriveSection 4 "SMART long selftest" "-t long" |
!insertmacro DriveSection 5 "SMART continue selective selftest" '-t "selective,cont"' |
!insertmacro DriveSection 5 "SMART continue selective selftest" '-t "selective,cont"' |
|
|
SectionGroupEnd |
SectionGroupEnd |
|
|
Section "UBCD4Win Plugin" UBCD_SECTION |
|
|
|
SectionIn 4 |
|
|
|
SetOutPath "$UBCDDIR" |
|
DetailPrint "Create file: smartmontools.inf" |
|
FileOpen $0 "$UBCDDIR\smartmontools.inf" "w" |
|
FileWrite $0 '; smartmontools.inf$\r$\n; PE Builder v3 plug-in INF file$\r$\n' |
|
FileWrite $0 '; Created by smartmontools installer$\r$\n' |
|
FileWrite $0 '; http://smartmontools.sourceforge.net/$\r$\n$\r$\n' |
|
FileWrite $0 '[Version]$\r$\nSignature= "$$Windows NT$$"$\r$\n$\r$\n' |
|
FileWrite $0 '[PEBuilder]$\r$\nName="Disk -Diagnostic: smartmontools"$\r$\n' |
|
FileWrite $0 'Enable=1$\r$\nHelp="files\smartctl.8.html"$\r$\n$\r$\n' |
|
FileWrite $0 '[WinntDirectories]$\r$\na=Programs\smartmontools,2$\r$\n$\r$\n' |
|
FileWrite $0 '[SourceDisksFolders]$\r$\nfiles=a,,1$\r$\n$\r$\n' |
|
FileWrite $0 '[Append]$\r$\nnu2menu.xml, smartmontools_nu2menu.xml$\r$\n' |
|
FileClose $0 |
|
|
|
DetailPrint "Create file: smartmontools_nu2menu.xml" |
|
FileOpen $0 "$UBCDDIR\smartmontools_nu2menu.xml" "w" |
|
FileWrite $0 '<!-- Nu2Menu entry for smartmontools -->$\r$\n<NU2MENU>$\r$\n' |
|
FileWrite $0 '$\t<MENU ID="Programs">$\r$\n$\t$\t<MITEM TYPE="POPUP" MENUID="Disk Tools">' |
|
FileWrite $0 'Disk Tools</MITEM>$\r$\n$\t</MENU>$\r$\n$\t<MENU ID="Disk Tools">$\r$\n' |
|
FileWrite $0 '$\t$\t<MITEM TYPE="POPUP" MENUID="Diagnostic">Diagnostic</MITEM>$\r$\n$\t</MENU>' |
|
FileWrite $0 '$\r$\n$\t<MENU ID="Diagnostic">$\r$\n$\t$\t<MITEM TYPE="ITEM" DISABLED="' |
|
FileWrite $0 '@Not(@FileExists(@GetProgramDrive()\Programs\smartmontools\smartctl.exe))" ' |
|
FileWrite $0 'CMD="RUN" FUNC="cmd.exe /k cd /d @GetProgramDrive()\Programs\smartmontools&' |
|
FileWrite $0 'set PATH=@GetProgramDrive()\Programs\smartmontools;%PATH% ">' |
|
FileWrite $0 'smartctl</MITEM>$\r$\n$\t</MENU>$\r$\n</NU2MENU>$\r$\n' |
|
FileClose $0 |
|
|
|
SetOutPath "$UBCDDIR\files" |
|
File "${INPDIR}\bin\smartctl.exe" |
|
File "${INPDIR}\bin\smartd.exe" |
|
File "${INPDIR}\doc\smartctl.8.html" |
|
File "${INPDIR}\doc\smartctl.8.txt" |
|
File "${INPDIR}\doc\smartd.8.html" |
|
File "${INPDIR}\doc\smartd.8.txt" |
|
File "${INPDIR}\doc\smartd.conf" |
|
|
|
SectionEnd |
|
|
|
|
|
;-------------------------------------------------------------------- |
;-------------------------------------------------------------------- |
|
|
Section "Uninstall" |
Section "Uninstall" |
Line 404 Section "Uninstall"
|
Line 387 Section "Uninstall"
|
ReadRegStr $0 HKLM "System\CurrentControlSet\Services\smartd" "ImagePath" |
ReadRegStr $0 HKLM "System\CurrentControlSet\Services\smartd" "ImagePath" |
StrCmp $0 "" nosrv |
StrCmp $0 "" nosrv |
ExecWait "net stop smartd" |
ExecWait "net stop smartd" |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Remove smartd service ?" IDYES 0 IDNO nosrv | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Remove smartd service ?" /SD IDNO IDYES 0 IDNO nosrv |
ExecWait "$INSTDIR\bin\smartd.exe remove" |
ExecWait "$INSTDIR\bin\smartd.exe remove" |
nosrv: |
nosrv: |
|
|
Line 418 Section "Uninstall"
|
Line 401 Section "Uninstall"
|
GetFileTime "$INSTDIR\bin\smartd.conf" $0 $1 |
GetFileTime "$INSTDIR\bin\smartd.conf" $0 $1 |
GetFileTime "$INSTDIR\doc\smartd.conf" $2 $3 |
GetFileTime "$INSTDIR\doc\smartd.conf" $2 $3 |
StrCmp "$0:$1" "$2:$3" +2 0 |
StrCmp "$0:$1" "$2:$3" +2 0 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete configuration file$\n$INSTDIR\bin\smartd.conf ?" IDYES 0 IDNO noconf | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete configuration file$\n$INSTDIR\bin\smartd.conf ?" /SD IDNO IDYES 0 IDNO noconf |
Delete "$INSTDIR\bin\smartd.conf" |
Delete "$INSTDIR\bin\smartd.conf" |
noconf: |
noconf: |
|
|
; Remove log file ? |
; Remove log file ? |
IfFileExists "$INSTDIR\bin\smartd.log" 0 +3 |
IfFileExists "$INSTDIR\bin\smartd.log" 0 +3 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete log file$\n$INSTDIR\bin\smartd.log ?" IDYES 0 IDNO +2 | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete log file$\n$INSTDIR\bin\smartd.log ?" /SD IDNO IDYES 0 IDNO +2 |
Delete "$INSTDIR\bin\smartd.log" |
Delete "$INSTDIR\bin\smartd.log" |
|
|
; Remove drivedb-add file ? |
; Remove drivedb-add file ? |
IfFileExists "$INSTDIR\bin\drivedb-add.h" 0 +3 |
IfFileExists "$INSTDIR\bin\drivedb-add.h" 0 +3 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete local drive database file$\n$INSTDIR\bin\drivedb-add.h ?" IDYES 0 IDNO +2 | MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete local drive database file$\n$INSTDIR\bin\drivedb-add.h ?" /SD IDNO IDYES 0 IDNO +2 |
Delete "$INSTDIR\bin\drivedb-add.h" |
Delete "$INSTDIR\bin\drivedb-add.h" |
|
|
; Remove files |
; Remove files |
Delete "$INSTDIR\bin\smartctl.exe" |
Delete "$INSTDIR\bin\smartctl.exe" |
Delete "$INSTDIR\bin\smartctl-nc.exe" |
Delete "$INSTDIR\bin\smartctl-nc.exe" |
Delete "$INSTDIR\bin\smartd.exe" |
Delete "$INSTDIR\bin\smartd.exe" |
Delete "$INSTDIR\bin\syslogevt.exe" | Delete "$INSTDIR\bin\smartd_warning.cmd" ; TODO: Check for modifications? |
Delete "$INSTDIR\bin\drivedb.h" |
Delete "$INSTDIR\bin\drivedb.h" |
Delete "$INSTDIR\bin\drivedb.h.error" |
Delete "$INSTDIR\bin\drivedb.h.error" |
Delete "$INSTDIR\bin\drivedb.h.lastcheck" |
Delete "$INSTDIR\bin\drivedb.h.lastcheck" |
Line 449 Section "Uninstall"
|
Line 432 Section "Uninstall"
|
Delete "$INSTDIR\bin\runcmda.exe.manifest" |
Delete "$INSTDIR\bin\runcmda.exe.manifest" |
Delete "$INSTDIR\bin\runcmdu.exe" |
Delete "$INSTDIR\bin\runcmdu.exe" |
Delete "$INSTDIR\bin\runcmdu.exe.manifest" |
Delete "$INSTDIR\bin\runcmdu.exe.manifest" |
|
Delete "$INSTDIR\bin\wtssendmsg.exe" |
Delete "$INSTDIR\doc\AUTHORS.txt" |
Delete "$INSTDIR\doc\AUTHORS.txt" |
Delete "$INSTDIR\doc\CHANGELOG.txt" | Delete "$INSTDIR\doc\ChangeLog.txt" |
| Delete "$INSTDIR\doc\ChangeLog-5.0-6.0.txt" |
Delete "$INSTDIR\doc\COPYING.txt" |
Delete "$INSTDIR\doc\COPYING.txt" |
Delete "$INSTDIR\doc\INSTALL.txt" |
Delete "$INSTDIR\doc\INSTALL.txt" |
Delete "$INSTDIR\doc\NEWS.txt" |
Delete "$INSTDIR\doc\NEWS.txt" |
Delete "$INSTDIR\doc\README.txt" |
Delete "$INSTDIR\doc\README.txt" |
Delete "$INSTDIR\doc\TODO.txt" |
Delete "$INSTDIR\doc\TODO.txt" |
Delete "$INSTDIR\doc\WARNINGS.txt" |
Delete "$INSTDIR\doc\WARNINGS.txt" |
Delete "$INSTDIR\doc\checksums.txt" | Delete "$INSTDIR\doc\checksums*.txt" |
Delete "$INSTDIR\doc\smartctl.8.html" |
Delete "$INSTDIR\doc\smartctl.8.html" |
Delete "$INSTDIR\doc\smartctl.8.txt" |
Delete "$INSTDIR\doc\smartctl.8.txt" |
Delete "$INSTDIR\doc\smartd.8.html" |
Delete "$INSTDIR\doc\smartd.8.html" |
Line 484 Section "Uninstall"
|
Line 469 Section "Uninstall"
|
RMDir "$INSTDIR" |
RMDir "$INSTDIR" |
|
|
; Remove install dir from PATH |
; Remove install dir from PATH |
IfFileExists "$WINDIR\system32\cmd.exe" 0 +3 | Push "$INSTDIR\bin" |
Push "$INSTDIR\bin" | Call un.RemoveFromPath |
Call un.RemoveFromPath | |
|
|
; Remove drive menu registry entries |
; Remove drive menu registry entries |
!insertmacro DriveMenuRemove |
!insertmacro DriveMenuRemove |
|
|
; Check for still existing entries |
; Check for still existing entries |
IfFileExists "$INSTDIR\bin\smartd.exe" 0 +3 |
IfFileExists "$INSTDIR\bin\smartd.exe" 0 +3 |
MessageBox MB_OK|MB_ICONEXCLAMATION "$INSTDIR\bin\smartd.exe could not be removed.$\nsmartd is possibly still running." | MessageBox MB_OK|MB_ICONEXCLAMATION "$INSTDIR\bin\smartd.exe could not be removed.$\nsmartd is possibly still running." /SD IDOK |
Goto +3 |
Goto +3 |
IfFileExists "$INSTDIR" 0 +2 |
IfFileExists "$INSTDIR" 0 +2 |
MessageBox MB_OK "Note: $INSTDIR could not be removed." | MessageBox MB_OK "Note: $INSTDIR could not be removed." /SD IDOK |
|
|
IfFileExists "$SMPROGRAMS\smartmontools" 0 +2 |
IfFileExists "$SMPROGRAMS\smartmontools" 0 +2 |
MessageBox MB_OK "Note: $SMPROGRAMS\smartmontools could not be removed." | MessageBox MB_OK "Note: $SMPROGRAMS\smartmontools could not be removed." /SD IDOK |
|
|
SectionEnd |
SectionEnd |
|
|
;-------------------------------------------------------------------- |
;-------------------------------------------------------------------- |
; Functions |
; Functions |
|
|
|
!macro AdjustSectionSize section |
|
SectionGetSize ${section} $0 |
|
IntOp $0 $0 / 2 |
|
SectionSetSize ${section} $0 |
|
!macroend |
|
|
Function .onInit |
Function .onInit |
|
|
|
; Set default install directories |
|
StrCmp $INSTDIR "" 0 endinst ; /D=PATH option specified ? |
|
ReadRegStr $INSTDIR HKLM "Software\smartmontools" "Install_Dir" |
|
StrCmp $INSTDIR "" 0 endinst ; Already installed ? |
|
StrCpy $INSTDIR "$PROGRAMFILES\smartmontools" |
|
!ifdef INPDIR64 |
|
StrCpy $INSTDIR32 $INSTDIR |
|
StrCpy $INSTDIR64 "$PROGRAMFILES64\smartmontools" |
|
!endif |
|
endinst: |
|
|
|
!ifdef INPDIR64 |
|
; Sizes of binary sections include 32-bit and 64-bit executables |
|
!insertmacro AdjustSectionSize ${SMARTCTL_SECTION} |
|
!insertmacro AdjustSectionSize ${SMARTD_SECTION} |
|
!insertmacro AdjustSectionSize ${SMARTCTL_NC_SECTION} |
|
!endif |
|
|
; Use Notepad++ if installed |
; Use Notepad++ if installed |
StrCpy $EDITOR "$PROGRAMFILES\Notepad++\notepad++.exe" |
StrCpy $EDITOR "$PROGRAMFILES\Notepad++\notepad++.exe" |
IfFileExists "$EDITOR" +2 0 |
IfFileExists "$EDITOR" +2 0 |
StrCpy $EDITOR "notepad.exe" |
StrCpy $EDITOR "notepad.exe" |
|
|
; Get UBCD4Win install location | Call ParseCmdLine |
ReadRegStr $0 HKLM "Software\UBCD4Win" "InstallPath" | FunctionEnd |
StrCmp $0 "" 0 +2 | |
StrCpy $0 "C:\UBCD4Win" | |
StrCpy $UBCDDIR "$0\plugin\Disk\Diagnostic\smartmontools" | |
|
|
; Hide "Add install dir to PATH" on 9x/ME | ; Check x64 section and update INSTDIR accordingly |
IfFileExists "$WINDIR\system32\cmd.exe" +2 0 | |
SectionSetText ${PATH_SECTION} "" | |
|
|
Call ParseCmdLine | !ifdef INPDIR64 |
| Function CheckX64 |
| SectionGetFlags ${X64_SECTION} $0 |
| IntOp $0 $0 & ${SF_SELECTED} |
| IntCmp $0 ${SF_SELECTED} x64 |
| StrCpy $X64 "" |
| StrCmp $INSTDIR32 "" +3 |
| StrCpy $INSTDIR $INSTDIR32 |
| StrCpy $INSTDIR32 "" |
| Goto done |
| x64: |
| StrCpy $X64 "t" |
| StrCmp $INSTDIR64 "" +3 |
| StrCpy $INSTDIR $INSTDIR64 |
| StrCpy $INSTDIR64 "" |
| done: |
FunctionEnd |
FunctionEnd |
|
!endif |
|
|
; Command line parsing |
; Command line parsing |
!macro CheckCmdLineOption name section |
!macro CheckCmdLineOption name section |
Line 554 Function ParseCmdLine
|
Line 573 Function ParseCmdLine
|
Var /global nomatch |
Var /global nomatch |
StrCpy $nomatch "t" |
StrCpy $nomatch "t" |
; turn sections on or off |
; turn sections on or off |
|
!ifdef INPDIR64 |
|
!insertmacro CheckCmdLineOption "x64" ${X64_SECTION} |
|
Call CheckX64 |
|
StrCmp $opts "x64" 0 +2 |
|
Return ; leave sections unchanged if only "x64" is specified |
|
!endif |
!insertmacro CheckCmdLineOption "smartctl" ${SMARTCTL_SECTION} |
!insertmacro CheckCmdLineOption "smartctl" ${SMARTCTL_SECTION} |
!insertmacro CheckCmdLineOption "smartd" ${SMARTD_SECTION} |
!insertmacro CheckCmdLineOption "smartd" ${SMARTD_SECTION} |
!insertmacro CheckCmdLineOption "smartctlnc" ${SMARTCTL_NC_SECTION} |
!insertmacro CheckCmdLineOption "smartctlnc" ${SMARTCTL_NC_SECTION} |
Line 569 Function ParseCmdLine
|
Line 594 Function ParseCmdLine
|
!insertmacro CheckCmdLineOption "drive3" ${DRIVE_3_SECTION} |
!insertmacro CheckCmdLineOption "drive3" ${DRIVE_3_SECTION} |
!insertmacro CheckCmdLineOption "drive4" ${DRIVE_4_SECTION} |
!insertmacro CheckCmdLineOption "drive4" ${DRIVE_4_SECTION} |
!insertmacro CheckCmdLineOption "drive5" ${DRIVE_5_SECTION} |
!insertmacro CheckCmdLineOption "drive5" ${DRIVE_5_SECTION} |
!insertmacro CheckCmdLineOption "ubcd" ${UBCD_SECTION} |
|
StrCmp $opts "-" done |
StrCmp $opts "-" done |
StrCmp $nomatch "" done |
StrCmp $nomatch "" done |
StrCpy $0 "$allopts,-" "" 1 |
StrCpy $0 "$allopts,-" "" 1 |
Line 578 Function ParseCmdLine
|
Line 602 Function ParseCmdLine
|
done: |
done: |
FunctionEnd |
FunctionEnd |
|
|
; Directory page callbacks |
|
|
|
!macro CheckSection section |
|
SectionGetFlags ${section} $0 |
|
IntOp $0 $0 & 1 |
|
IntCmp $0 1 done |
|
!macroend |
|
|
|
Function SkipProgPath |
|
!insertmacro CheckSection ${SMARTCTL_SECTION} |
|
!insertmacro CheckSection ${SMARTCTL_NC_SECTION} |
|
!insertmacro CheckSection ${SMARTD_SECTION} |
|
!insertmacro CheckSection ${DRIVEDB_SECTION} |
|
!insertmacro CheckSection ${DOC_SECTION} |
|
!insertmacro CheckSection ${MENU_SECTION} |
|
!insertmacro CheckSection ${PATH_SECTION} |
|
!insertmacro CheckSection ${DRIVE_0_SECTION} |
|
!insertmacro CheckSection ${DRIVE_1_SECTION} |
|
!insertmacro CheckSection ${DRIVE_2_SECTION} |
|
!insertmacro CheckSection ${DRIVE_3_SECTION} |
|
!insertmacro CheckSection ${DRIVE_4_SECTION} |
|
!insertmacro CheckSection ${DRIVE_5_SECTION} |
|
Abort |
|
done: |
|
FunctionEnd |
|
|
|
Function SkipUBCDPath |
|
!insertmacro CheckSection ${UBCD_SECTION} |
|
Abort |
|
done: |
|
FunctionEnd |
|
|
|
|
|
; Install runcmda.exe if missing |
; Install runcmda.exe if missing |
|
|
Function CheckRunCmdA |
Function CheckRunCmdA |
IfFileExists "$INSTDIR\bin\runcmda.exe" done 0 |
IfFileExists "$INSTDIR\bin\runcmda.exe" done 0 |
SetOutPath "$INSTDIR\bin" |
SetOutPath "$INSTDIR\bin" |
File "${INPDIR}\bin\runcmda.exe" | !insertmacro FileExe "bin\runcmda.exe" "" |
File "${INPDIR}\bin\runcmda.exe.manifest" |
File "${INPDIR}\bin\runcmda.exe.manifest" |
done: |
done: |
FunctionEnd |
FunctionEnd |
Line 789 FunctionEnd
|
Line 780 FunctionEnd
|
!endif |
!endif |
|
|
Function ShellLinkSetRunAs |
Function ShellLinkSetRunAs |
|
; Set archive location of $PLUGINSDIR |
|
Goto +2 |
|
SetOutPath "$INSTDIR" |
|
|
System::Store S ; push $0-$9, $R0-$R9 |
System::Store S ; push $0-$9, $R0-$R9 |
pop $9 |
pop $9 |
; $0 = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLink, &$1) |
; $0 = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLink, &$1) |