; mactor.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
; optional settings are left to their default settings. The instalelr simply
; prompts the user asking them where to install, and drops of notepad.exe
; there. If your Windows directory is not C:\windows, change it below.
;
!define ALL_USERS
!include "LogicLib.nsh"
!include "WinMessages.NSH"
!include "registerExtension.nsh"
!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define hkcu_current_user 'HKCU "Environment"'
!define version "${version}"
; The name of the installer
Name "MActor ${version}"
; The file to write
OutFile "mactor_${version}-setup.exe"
; The default installation directory
InstallDir $PROGRAMFILES\mactor_${version}
; The text to prompt the user to enter a directory
DirText "Choose a directory for MActor"
; The stuff to install
Section "installfiles"
SetOutPath $INSTDIR\lib
File "mactor_${version}\lib\*"
SetOutPath $INSTDIR\src
File /r "mactor_${version}\src\*.*"
SetOutPath $INSTDIR
File "mactor_${version}\*"
SetOutPath $INSTDIR\licenses
File "mactor_${version}\licenses\*.*"
SetOutPath $INSTDIR\bin
File "mactor_${version}\bin\*.bat"
#read the value from the registry into the $0 register
readRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" CurrentVersion
SectionEnd ; end the section
Section "initenv"
WriteRegExpandStr ${hklm_all_users} "MACTOR_HOME" $INSTDIR
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd ;
Section "regext"
${registerExtension} "$INSTDIR\bin\rungui.bat" ".mproject" "MActor Project File"
SectionEnd ;
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\MActor"
CreateShortCut "$SMPROGRAMS\MActor\MActor.lnk" "$INSTDIR\bin\rungui.bat" "" "$INSTDIR\bin\rungui.bat" 0
CreateShortCut "$SMPROGRAMS\MActor\Release Note.lnk" "$INSTDIR\release.txt" "" "$INSTDIR\release.txt" 0
CreateShortCut "$SMPROGRAMS\MActor\Source.lnk" "$INSTDIR\src" "" "$INSTDIR\src" 0
WriteINIStr "$SMPROGRAMS\MActor\MActor - Online.url" "InternetShortcut" "URL" "http://mactor.sourceforge.net/"
#SetShellVarContext "all"
#CreateShortCut "$SMPROGRAMS\MActor\MActor.lnk" "$EXEDIR\MActor.url" "" "$EXEDIR\makeURL.exe" 0 "SW_SHOWNORMAL" "" "MActor - Online"
SectionEnd
; eof