; NSIS installer for the remote microscope.
; $Id: microscope.nsi,v 1.3 2002/02/16 01:53:49 akuchlin Exp $
;
; Originally generated by makensitemplate.phtml 0.21
; by 132.151.7.3 on Feb 15 02 @ 12:18

Name "Remote Microscope"
OutFile "installscope.exe"

; Some default compiler settings (uncomment and change at will):
SetCompress auto ; (can be off or force)
; SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
; AutoCloseWindow false ; (can be true for the window go away automatically at end)
; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)

InstallDir "$PROGRAMFILES\MEMS Exchange\Remote Microscope"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\MEMS Exchange\Remote Microscope" ""
DirShow show ; (make this hide to not let the user change it)
DirText "Select the directory to install the Remote Microscope software:"

Section "" ; (default section)
SetOutPath "$INSTDIR"
File /r c:\mems\mems\instrument\client\tk\dist\application\*.*

; Create shortcut
CreateDirectory "$STARTMENU\Programs\MEMS Exchange\"
CreateShortCut "$STARTMENU\Programs\MEMS Exchange\Remote Microscope.lnk" $INSTDIR\application.exe
CreateShortCut "$STARTMENU\Programs\MEMS Exchange\Uninstall Remote Microscope.lnk" $INSTDIR\uninst.exe

; Set registry keys
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\MEMS Exchange\Remote Microscope" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Remote Microscope" "DisplayName" "Remote Microscope (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Remote Microscope" "UninstallString" '"$INSTDIR\uninst.exe"'

; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
SectionEnd ; end of default section


; begin uninstall settings/section
UninstallText "This will uninstall the Remote Microscope from your system"

Section Uninstall
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\uninst.exe"
Delete "$STARTMENU\Programs\MEMS Exchange\Remote Microscope.lnk"
Delete "$STARTMENU\Programs\MEMS Exchange\Uninstall Remote Microscope.lnk"
Rmdir "$STARTMENU\Programs\MEMS Exchange"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\MEMS Exchange\Remote Microscope"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Remote Microscope"
RMDir /r "$INSTDIR"
SectionEnd ; end of uninstall section

