; This script attempts to test most of the functionality of the NSIS exehead. ;-------------------------------- !define VERSION "0.1" !define Project "payroll" !define Source "F:\Data\Development\eclipse" ;"D:\Development\eclipse\workspace" !define Installer "C:\";"F:\Data\Development\writeCD\Installer\${Project}" !define Installer_JDK "E:\download\java\JSDK\j2sdk-1_4_0-win.exe" ;"E:\a\a\j2re-1_4_2-windows-i586.exe" !define Installer_Tomcat "E:\download\java\Tomcat\jakarta-tomcat-4.1.18.exe" !define Installer_MySQL "setup.exe" !define HWNDPARENT Name "${Project} ${VERSION}" Caption "Billing System" Icon "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico" OutFile "${Installer}\${Project}-setup.exe" SetDateSave on SetDatablockOptimize on CRCCheck on SilentInstall normal BGGradient 000000 800000 FFFFFF InstallColors FF8080 000030 XPStyle on CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\simple-round.bmp" ;-------------------------------- Page components Page instfiles Page Custom ShowCustom UninstPage uninstConfirm UninstPage instfiles ;-------------------------------- AutoCloseWindow false ShowInstDetails show ;-------------------------------- Section "JDK" ClearErrors ReadRegStr $0 HKLM "Software\JavaSoft\Java Development Kit\1.4.2_06" JavaHome IfErrors 0 +2 ExecWait ${Installer_JDK} ; run if never have a JDK DetailPrint "JDK is installed at: $0" SectionEnd Section "MySQL" ClearErrors SetOutPath "$TEMP\MySQL" ReserveFile "E:\download\database\mysql\Mysql Engine\mysql-4.0.24-win\*.*" ReadRegStr $0 HKLM "Software\MySQL AB" "" IfErrors 0 +2 ExecWait $TEMP\${Installer_MySQL} ; run if never mySQL MessageBox MB_OK "Sudah selesai Install MySQL ?" DetailPrint "MySQL is installed at: $0" SectionEnd Section "Container" ClearErrors ReadRegStr $0 HKLM "Software\Apache Software Foundation\Tomcat\5.0" InstallPath IfErrors 0 +2 ExecWait ${Installer_Tomcat} ; run if never have a Tomcat SectionEnd Section /o "Create Database" ;Ask about MySQL Dir Page Custom ShowCustom CloseCustom SectionEnd Function ShowCustom GetDlgItem $1 $HWNDPARENT 1 ShowWindow $1 0 FunctionEnd Function CloseCustom Abort FunctionEnd Section "!Application" SectionIn RO ;required ;SetDetailsPrint none ReadRegStr $0 HKLM "Software\Apache Software Foundation\Tomcat\5.0" InstallPath IfErrors 0 +2 ReadRegStr $0 HKLM "Software\Apache Group\Tomcat\4.1" "" DetailPrint "Application is installed at: $0" CreateDirectory "$0\webapps\${Project}" ;xml File SetOutPath "$0\webapps\${Project}\WEB-INF" FILE /r "${Source}\${Project}\WEB-INF\web.xml" ;Classes SetOutPath "$0\webapps\${Project}\WEB-INF\classes" FILE /r "${Source}\${Project}\WEB-INF\classes\*.*" DELETE "$0\webapps\${Project}\WEB-INF\classes\History Bug" DELETE "$0\webapps\${Project}\WEB-INF\classes\History Masukkan" ;create shortcut UserInfo::GetName Pop $0 CreateShortCut "$DESKTOP\${Project}.lnk" "$PROGRAMFILES\Internet Explorer\IEXPLORE.EXE" "http:\\$0:8080\${Project}" SectionEnd ;-------------------------------- Function .onInit ;Only one Installer can run System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e' Pop $R0 StrCmp $R0 0 +3 MessageBox MB_OK "The installer is already running." Abort ;input text File "inputtext.ini" ;Close all IE loop: FindWindow $0 "IEFrame" IntCmp $0 0 done IsWindow $0 0 done System::Call 'user32::PostMessageA(i,i,i,i) i($0,${WM_CLOSE},0,0)' Sleep 100 Goto loop done: FunctionEnd ;-------------------------------- ;Version Information LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf" VIProductVersion "1.0.6.0" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Billing SPA" VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Billing System" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "IBSolution" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Billing System Webtop is a trademark of IBSolution company" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© IBSolution company" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "System integrasi untuk pembayaran" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.0"