;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ;Description : Installation FARGEOT ; ; ; ;Auteur : Jean-Pierre CLARY ; ; ; ;----------------------------------------------------------------------------------------; ; Ver. ! Date ! Commentaire ; ; ! ! ; ; 1.0 !18/11/2002! Version de base. ; ; ! ! ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SilentInstall normal AutoCloseWindow true !define VER_MAJOR 1 !define VER_MINOR 15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;General installer configuration; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OutFile FGPV${VER_MAJOR}.${VER_MINOR}.exe Name "Fargeot GP" Caption "Installation de Fargeot GP v${VER_MAJOR}.${VER_MINOR}" Subcaption 0 ": Licence " Subcaption 1 ": Option d'installation" Subcaption 2 ": Repertoire d'installation" Subcaption 3 ": Installation en cours..." Brandingtext "Installation Fargeot GP" BGGradient 308030 00FF80 FFFFFF MiscButtonText "< &Précédent" "&Suivant >" "Annuler" "Fermer" InstallButtonText "Installer" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Install directory configuration; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; InstallDir C:\Fargeot InstallDirRegKey HKLM SOFTWARE\GTM\Fargeot_GP "Install_Dir" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Component page configuration; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ComponentText "Vous êtes sur le point d'installer Fargeot GP V${VER_MAJOR}.${VER_MINOR} sur votre ordinateur:" " " "&Composants" Enabledbitmap check.bmp Disabledbitmap uncheck.bmp Spacetexts "Espace nécessaire" "Espace disponible" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Directory page configuration; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DirText "Selectionner la destination de l'installation:" "Dossier d'installation" "Par&courir..." ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Install page configuration; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; InstallColors 00FF80 000000 InstProgressFlags smooth colored AutoCloseWindow false ShowInstDetails show Completedtext "Installation terminée" ;;;;;;;;;;;;;;;;;;;;;;;;; ;Uninstall configuration; ;;;;;;;;;;;;;;;;;;;;;;;;; UninstallText "Ceci va désinstaller Fargeot GP :" "Désinstaller depuis:" ShowUninstDetails show UninstallCaption "Désinstallation de Fargeot GP" uninstallbuttontext "Désinstaller" uninstallSubcaption 1 ": Désinstallation des fichiers" uninstallSubcaption 2 ": Désinstallation terminée" ;;;;;;;;;;;;;;;; ;Compiler flags; ;;;;;;;;;;;;;;;; SetCompress auto SetDatablockOptimize on CRCCheck off SetOverwrite on SetDateSave on ;;;;;;;;;;; ;Fonctions; ;;;;;;;;;;; ;logo FARGEOT au lancement de l'install ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInit SetOutPath $TEMP File /oname=spltmp.bmp "fargeot.bmp" File /oname=spltmp.exe "splash.exe" ExecWait '"$TEMP\spltmp.exe" 2000 $HWNDPARENT spltmp' Delete $TEMP\spltmp.exe Delete $TEMP\spltmp.bmp FunctionEnd ;Fonction pour connaitre la version de windows ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function GetWindowsVersion Push $0 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $0 "" 0 lbl_winnt ; On est dans une arborescence de style Windows 9x ( 95,98,ME ) StrCpy $0 '9x' Goto lbl_done lbl_winnt: ; On est dans une arborescence de style NT ( NT 4, NT 5, 2000, XP ) Strcpy $0 'NT' lbl_done: Exch $0 FunctionEnd ; Macro de mise à jour des DLL sans registration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !macro UpgradeDLL LOCALFILE DESTFILE Push $R0 Push $R1 Push $R2 Push $R3 ;------------------------ ;Check file and version IfFileExists "${DESTFILE}" "" "copy_${LOCALFILE}" ClearErrors GetDLLVersionLocal "${LOCALFILE}" $R0 $R1 GetDLLVersion "${DESTFILE}" $R2 $R3 IfErrors "upgrade_${LOCALFILE}" IntCmpU $R0 $R2 "" "done_${LOCALFILE}" "upgrade_${LOCALFILE}" IntCmpU $R1 $R3 "done_${LOCALFILE}" "done_${LOCALFILE}" "upgrade_${LOCALFILE}" ;------------------------ ;Let's upgrade the DLL! SetOverwrite try "upgrade_${LOCALFILE}:" ;------------------------ ;Try to copy the DLL directly ClearErrors StrCpy $R0 "${DESTFILE}" Call ":file_${LOCALFILE}" IfErrors "" "noreboot_${LOCALFILE}" ;------------------------ ;DLL is in use. Copy it to a temp file and Rename it on reboot. GetTempFileName $R0 Call ":file_${LOCALFILE}" Rename /REBOOTOK $R0 "${DESTFILE}" Goto "done_${LOCALFILE}" ;------------------------ ;DLL does not exist - just extract "copy_${LOCALFILE}:" StrCpy $R0 "${DESTFILE}" Call ":file_${LOCALFILE}" ;------------------------ ;Register the DLL "noreboot_${LOCALFILE}:" ;------------------------ ;Done "done_${LOCALFILE}:" Pop $R3 Pop $R2 Pop $R1 Pop $R0 ;------------------------ ;End Goto "end_${LOCALFILE}" ;------------------------ ;Called to extract the DLL "file_${LOCALFILE}:" File /oname=$R0 "${LOCALFILE}" Return "end_${LOCALFILE}:" !macroend ; Macro de mise à jour des DLL avec registration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !macro UpgradeDLL_REG LOCALFILE DESTFILE Push $R0 Push $R1 Push $R2 Push $R3 ;------------------------ ;Check file and version IfFileExists "${DESTFILE}" "" "copy_${LOCALFILE}" ClearErrors GetDLLVersionLocal "${LOCALFILE}" $R0 $R1 GetDLLVersion "${DESTFILE}" $R2 $R3 IfErrors "upgrade_${LOCALFILE}" IntCmpU $R0 $R2 "" "done_${LOCALFILE}" "upgrade_${LOCALFILE}" IntCmpU $R1 $R3 "done_${LOCALFILE}" "done_${LOCALFILE}" "upgrade_${LOCALFILE}" ;------------------------ ;Let's upgrade the DLL! SetOverwrite try "upgrade_${LOCALFILE}:" ;Unregister the DLL UnRegDLL "${DESTFILE}" ;------------------------ ;Try to copy the DLL directly ClearErrors StrCpy $R0 "${DESTFILE}" Call ":file_${LOCALFILE}" IfErrors "" "noreboot_${LOCALFILE}" ;------------------------ ;DLL is in use. Copy it to a temp file and Rename it on reboot. GetTempFileName $R0 Call ":file_${LOCALFILE}" Rename /REBOOTOK $R0 "${DESTFILE}" ;------------------------ ;Register the DLL on reboot WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \ "Register ${DESTFILE}" '"$SYSDIR\rundll32.exe" "${DESTFILE},DllRegisterServer"' Goto "done_${LOCALFILE}" ;------------------------ ;DLL does not exist - just extract "copy_${LOCALFILE}:" StrCpy $R0 "${DESTFILE}" Call ":file_${LOCALFILE}" ;------------------------ ;Register the DLL "noreboot_${LOCALFILE}:" RegDLL "${DESTFILE}" ;------------------------ ;Done "done_${LOCALFILE}:" Pop $R3 Pop $R2 Pop $R1 Pop $R0 ;------------------------ ;End Goto "end_${LOCALFILE}" ;------------------------ ;Called to extract the DLL "file_${LOCALFILE}:" File /oname=$R0 "${LOCALFILE}" Return "end_${LOCALFILE}:" !macroend ;;;;;;;;;; ;Sections; ;;;;;;;;;; Section "Fargeot GP" Call GetWindowsVersion Pop $0 setoutpath $INSTDIR WriteRegStr HKLM SOFTWARE\GTM\Fargeot_GP "Install_Dir" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FARGEOT_GP" "DisplayName" "Fargeot GP" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FARGEOT_GP" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" SetOutPath $INSTDIR\tmp SetOutPath $INSTDIR\ini FileOpen $1 $INSTDIR\ini\fargeot.ini w FileWrite $1 "[Startup]$\r$\n" FileWrite $1 "V6Display=no$\r$\n" FileWrite $1 "DefaultFont=MS Sans Serif, size=8$\r$\n" FileWrite $1 "DefaultFixedFont=Courier New, size=8$\r$\n" FileWrite $1 "DLC=C:\DLC$\r$\n" FileWrite $1 "Use-3D-Size=Yes$\r$\n" FileWrite $1 "PROPATH=.,$INSTDIR,$INSTDIR\gui,C:DLC\gui$\r$\n" FileWrite $1 "[Colors]$\r$\n" FileWrite $1 "color0=0,0,0$\r$\n" FileWrite $1 "color1=0,0,128$\r$\n" FileWrite $1 "color2=0,128,0$\r$\n" FileWrite $1 "color3=0,128,128$\r$\n" FileWrite $1 "color4=128,0,0$\r$\n" FileWrite $1 "color5=128,0,128$\r$\n" FileWrite $1 "color6=128,128,0$\r$\n" FileWrite $1 "color7=128,128,128$\r$\n" FileWrite $1 "color8=192,192,192$\r$\n" FileWrite $1 "color9=0,0,255$\r$\n" FileWrite $1 "color10=0,255,0$\r$\n" FileWrite $1 "color11=0,255,255$\r$\n" FileWrite $1 "color12=255,0,0$\r$\n" FileWrite $1 "color13=255,0,255$\r$\n" FileWrite $1 "color14=255,255,0$\r$\n" FileWrite $1 "color15=255,255,255$\r$\n" FileWrite $1 "color16=255,255,0$\r$\n" FileWrite $1 "NORMAL=0,15$\r$\n" FileWrite $1 "INPUT=15,0$\r$\n" FileWrite $1 "MESSAGES=15,1$\r$\n" FileWrite $1 "[fonts]$\r$\n" FileWrite $1 "font0=Courier New, size=8$\r$\n" FileWrite $1 "font1=MS Sans Serif, size=8$\r$\n" FileWrite $1 "font2=Courier New, size=8$\r$\n" FileWrite $1 "font3=Courier New, size=8$\r$\n" FileWrite $1 "font4=MS Sans Serif, size=8$\r$\n" FileWrite $1 "font5=MS Sans Serif, size=10$\r$\n" FileWrite $1 "font6=MS Sans Serif, size=8, bold$\r$\n" FileWrite $1 "font7=MS Sans Serif, size=8$\r$\n" FileWrite $1 "[Fargeot]$\r$\n" FileWrite $1 ";Sécurisation$\r$\n" FileWrite $1 "DEL-AFF=NO$\r$\n" FileWrite $1 "CRE-AFF=NO$\r$\n" FileWrite $1 "USR-ADM=NO$\r$\n" FileWrite $1 "MAJ-NIV=NO$\r$\n" FileWrite $1 "ADR-ADM=NO$\r$\n" FileWriteByte $1 26 FileClose $1 FileOpen $1 $INSTDIR\ini\fargeot.pf w FileWrite $1 "-T tmp$\r$\n" FileWrite $1 "-E$\r$\n" FileWrite $1 "-d dmy$\r$\n" FileWrite $1 "-Bt 400$\r$\n" FileWrite $1 "-nb 200$\r$\n" FileWrite $1 "-mmax 8096$\r$\n" FileWrite $1 "-stream iso8859-1$\r$\n" FileWrite $1 "-q$\r$\n" FileWriteByte $1 26 FileClose $1 SectionEnd Section "Progress" Addsize "64448" setoverwrite on SetOutPath c:\dlc file /r c:\dlc\*.* SectionEnd Section "MAJ des bases" SetOutPath $INSTDIR\bas file d:\fargeot\bas\*.* SetOutPath $INSTDIR\dbs file d:\fargeot\bas\fg_lib.* IfFileExists $INSTDIR\dbs\fg_dat.db Fin_maj_bases SetOutPath $INSTDIR\dbs file d:\fargeot\bas\fg_dat.* Fin_maj_bases: SetOutPath $INSTDIR\gui\util file d:\fargeot\gui\util\*.* SetOutPath $INSTDIR\ini FileOpen $1 $INSTDIR\ini\fg_mjver.bat w FileWrite $1 "@echo off$\r$\n" FileWrite $1 "SET FARGEOT=$INSTDIR$\r$\n" FileWrite $1 "SET DLC=C:\DLC$\r$\n" FileWrite $1 "CD %FARGEOT%$\r$\n" FileWrite $1 "%DLC%\bin\prowin32.exe -rx -p util\pgmjver.p -ininame %FARGEOT%\ini\fargeot.ini -pf %FARGEOT%\ini\fargeot.pf -param %FARGEOT%$\r$\n" FileWrite $1 "EXIT$\r$\n" FileWriteByte $1 26 FileClose $1 execWait $INSTDIR\ini\fg_mjver.bat SectionEnd Section "MAJ application" Addsize "92352" SetOutPath $INSTDIR\gui\act file d:\fargeot\gui\act\*.rox file d:\fargeot\gui\act\*.rov SetOutPath $INSTDIR\gui\icone file d:\fargeot\gui\icone\*.* SetOutPath $INSTDIR\gui\objects file d:\fargeot\gui\objects\*.* SetOutPath $INSTDIR\gui\data file d:\fargeot\gui\data\*.* SetOutPath $INSTDIR\gui\trigger file d:\fargeot\gui\trigger\*.* SetOutPath $INSTDIR\gui\adm\objects file d:\fargeot\gui\adm\objects\*.* SetOutPath $INSTDIR\gui\proc file d:\fargeot\gui\proc\*.* SetOutPath $INSTDIR\gui\win file d:\fargeot\gui\win\*.* SetOutPath $INSTDIR\gui\wrx file d:\fargeot\gui\wrx\*.* SetOutPath $INSTDIR\gui\import SetOutPath $INSTDIR\ini file d:\fargeot\ini\*.fgp file d:\fargeot\ini\mod*.* SetOutPath $INSTDIR\activex\bin file d:\fargeot\activex\bin\*.ocx file d:\fargeot\activex\bin\*.dll file d:\fargeot\activex\bin\regsvr32.exe SetOutPath $INSTDIR\activex\cache file d:\fargeot\activex\cache\*.* SetOutPath $INSTDIR\activex\afc file d:\fargeot\activex\afc\*.* SetOutPath $INSTDIR\activex\etc file d:\fargeot\activex\etc\*.* FileOpen $1 $INSTDIR\ini\fargeot.bat w FileWrite $1 "@echo off$\r$\n" StrCmp $0 "9x" win9x winNT win9x: FileWrite $1 "$INSTDIR\INI\modhost $WINDIR\hosts $INSTDIR\ini\hosts.fgp$\r$\n" goto finIfgp winNT: FileWrite $1 "$INSTDIR\INI\modhost $SYSDIR\drivers\etc\hosts $INSTDIR\ini\hosts.fgp$\r$\n" finIfgp: FileWrite $1 "SET FARGEOT=$INSTDIR$\r$\n" FileWrite $1 "SET DLC=C:\DLC$\r$\n" FileWrite $1 "SET FARGEOTDB=%FARGEOT%\dbs$\r$\n" FileWrite $1 "SET PROCFG=%DLC%\progress.cfg$\r$\n" FileWrite $1 "SET PROMSGS=%DLC%\promsgs$\r$\n" FileWrite $1 "PATH=%DLC%;%DLC%\BIN;%PATH%$\r$\n" FileWrite $1 "CD %FARGEOT%$\r$\n" FileWrite $1 "IF '==%1' goto local$\r$\n" FileWrite $1 "%DLC%\bin\prowin32.exe -rr -p win/fargeot.r -ininame %FARGEOT%\ini\fargeot.ini -pf %FARGEOT%\ini\fargeot.pf -param %1$\r$\n" FileWrite $1 "goto fin$\r$\n" FileWrite $1 ":local$\r$\n" FileWrite $1 "%DLC%\bin\prowin32.exe -rr -p win/fargeot.r -ininame %FARGEOT%\ini\fargeot.ini -pf %FARGEOT%\ini\fargeot.pf$\r$\n" FileWrite $1 ":fin$\r$\n" FileWriteByte $1 26 FileClose $1 SetOutPath $INSTDIR ; Création des raccourcis bureau et menu démarrer ReadEnvStr $2 "comspec" CreateDirectory "$SMPROGRAMS\Fargeot" CreateShortCut "$DESKTOP\fargeot GP.lnk" \ "$2" "/E:2048 /C $INSTDIR\ini\Fargeot.bat" "$INSTDIR\gui\icone\Logfgp.ico" 0 SW_SHOWMINIMIZED CreateShortCut "$SMPROGRAMS\Fargeot\Fargeot GP.lnk" \ "$2" "/E:2048 /C $INSTDIR\ini\Fargeot.bat" "$INSTDIR\gui\icone\logfgp.ico" 0 SW_SHOWMINIMIZED CreateShortCut "$SMPROGRAMS\Fargeot\Désinstallation de Fargeot GP.lnk" \ "$INSTDIR\uninstall.exe" " " "$INSTDIR\gui\icone\uninst.ico" 0 SW_SHOWMINIMIZED SectionEnd Section "Mise à jour des activeX" ; Maj des DLL SetOutPath $SYSDIR file d:\fargeot\winsys\acr*.dll file d:\fargeot\winsys\g*.* file d:\fargeot\winsys\l*.dll !insertmacro UpgradeDLL "D:\FARGEOT\winsys\mfcans32.dll" "$SYSDIR\mfcans32.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\msvcirt.dll" "$SYSDIR\msvcirt.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\msvcrt.dll" "$SYSDIR\msvcrt.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\msvcrt40.dll" "$SYSDIR\msvcrt40.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\oc30.dll" "$SYSDIR\oc30.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\olepro32.dll" "$SYSDIR\olepro32.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\promsgs.dll" "$SYSDIR\promsgs.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\widge32.dll" "$SYSDIR\widge32.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\winrpc32.dll" "$SYSDIR\winrpc32.dll" !insertmacro UpgradeDLL "D:\FARGEOT\winsys\stdole32.tlb" "$SYSDIR\stdole32.tlb" !insertmacro UpgradeDLL_REG "D:\FARGEOT\winsys\oleaut32.dll" "$SYSDIR\oleaut32.dll" StrCmp $0 "9x" win9x winNT win9x: !insertmacro UpgradeDLL_REG "D:\FARGEOT\winsys\mfc42.dll" "$SYSDIR\mfc42.dll" goto finMFC42 winNT: !insertmacro UpgradeDLL_REG "D:\FARGEOT\winnt\mfc42.dll" "$SYSDIR\mfc42.dll" finMFC42: SetOverwrite on execWait '$INSTDIR\ini\regsvr32.exe Anatab32.ocx' RegDLL "$INSTDIR\activex\bin\Comctl32.ocx" RegDLL "$INSTDIR\activex\bin\AXDesk.dll" Addsize "30" IfRebootFlag TestReboot FinActivex TestReboot: MessageBox MB_YESNO " Une mise à jour du système a été effectuée. Réinitialisation de la machine maintenant ?" IDNO FinActivex Reboot FinActivex: SectionEnd section "Uninstall" rmdir /r $SMPROGRAMS\fargeot delete $DESKTOP\fargeot*.* MessageBox MB_YESNO " Souhaitez-vous désinstaller PROGRESS ?" IDNO NoDelprogAbort ;Suppression de Progress rmdir /r c:\dlc NoDelProgAbort: ;Supression de fargeot rmdir /r $INSTDIR deleteRegKey HKLM "Software\GTM\Fargeot_GP" deleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FARGEOT_GP" sectionend Function .onUserAbort MessageBox MB_YESNO " Souhaitez-vous arréter l'installation ?" IDYES NoCancelAbort Abort ; causes installer to not quit. NoCancelAbort: FunctionEnd Function .onInstFailed MessageBox MB_OK "Il y a eu un probleme d'installation" FunctionEnd ;eof