JohanV Posted July 16, 2008 Share Posted July 16, 2008 Hello there, I'm not a very good programmer, but i'm still learning a lot. For my work, i've created the code below to install a few applications. Most of them are .EXE or .MSI files. All of them are running silent. In the code below, I created a progress-bar. As you can see, this is not the optimal method of creating a progress-bar. That's why I put this question in this forum. In my current project, the progress-bar updates after or before an instruction. What I want is a progress-bar that updates in realtime or, if it's possible, 2 progress-bars: one for the 'overall progress' and another for the 'current installation progress'. Is it possible to let the progress-bar read the information from a MSI-file? Or are there other / better ways to make the progress-bar update more smoothly? Here's my code: CODE#include <guiconstants.au3> ; Install locations & Software settings $serverlocation = ("\\deployserver\install$\installs\ApplicationStudiosoftware\") $installdir = IniRead($serverlocation & "Applicationinstall.ini", "Pathnames", "Installdir", "Application_Studiosoftware\installers") $verenigNONO = IniRead($serverlocation & "Applicationinstall.ini", "InstallerLocations", "verenigNONO", "Diversen\ApplicationverenigNONOClient.msi") $StudiosoftwareFramework = Iniread($serverlocation & "Applicationinstall.ini", "InstallerLocations", "StudiosoftwareFramework", "framework\Studiosoftwareframeworksetup.exe") $StudiosoftwareAccess = Iniread($serverlocation & "Applicationinstall.ini", "InstallerLocations", "StudiosoftwareAccess", "Studiosoftwareacsetup.exe") $StudiosoftwareAssist = Iniread($serverlocation & "Applicationinstall.ini", "InstallerLocations", "StudiosoftwareAssist", "ApplicationStudiosoftwareassist\k1\setup.exe") $settingspath = IniRead($serverlocation & "Applicationinstall.ini", "Pathnames", "Settings", "Diversen") $versionjava = IniRead($serverlocation & "Applicationinstall.ini", "OtherRequired", "JavaVersion", "5.0.100.3") $versioninstaller = IniRead($serverlocation & "Applicationinstall.ini", "OtherRequired", "InstallerVersion", "3.1.4000.1823") $i = 1 ; Preparing installation ProgressOn ("Installatie Application Studiosoftware", "Installation / update Application Studiosoftware", "0 %", -1,1,16) ProgressSet( $i, $i & " % Preparing") DirCopy("\\deployserver\install$\installs\ApplicationStudiosoftware\Diversen\Uninstall", "c:\Applicationinst", 1) $i = $i + 1 ProgressSet( $i, $i & " % Zoeken naar geïnstalleerde bestanden") ShellExecuteWait("c:\Applicationinst\Application-uninstall.vbs", @SW_HIDE) $i = $i + 1 ProgressSet( $i, $i & " % Verwijderen geïnstalleerde versie") ;RunWait("C:\Applicationinst\uninstall.bat", "", @SW_HIDE) shellexecutewait("c:\Applicationinst\logs\"& @ComputerName &"\RUN_UNINSTALL.bat", @SW_HIDE) ; CHECK WINDOWS INSTALLER EN JAVA VERSION $i = $i + 2 ProgressSet( $i, $i & " % Checking Windows Installer") $instver = FileGetVersion("msiexec.exe") if $instver < $versioninstaller then msgbox(16, "Installatie voortijdig afgebroken", "Windows Installer versie 1.3 of hoger is niet aangetroffen op dit systeem.") Exit EndIf $i = $i + 5 ProgressSet( $i, $i & " % Controleren Java versie") $javaver = FileGetVersion("Java.exe") If $javaver < $versionjava then ProgressSet( $i, $i & " % Installeren Java Runtime Environment") RunWait ($serverlocation & $settingspath & "\java.exe /s") EndIf $i = $i + 10 ; INSTALLATIE Application verenig NONO cliënt (Progress: 20 %) ProgressSet( $i, $i & " % (Installeren: Application verenig NONO Client)") runwait ("msiexec.exe /i " & $serverlocation & $verenigNONO & " /passive /norestart") $i = $i + 20 ; INSTALLATIE Application Studiosoftware Framework (Progress: 40 %) ProgressSet( $i, $i & " % (Installeren: Application Studiosoftware Framework)") RunWait ($serverlocation & $installdir & $StudiosoftwareFramework & ' /s /v"/qb! ADDLOCAL=Core,JVM,ConfigUtilApp,DiagLogViewer,HealthVwr,MachineMonitor,TimeSync WORKGROUPNAME=ApplicationWorkgroup REBOOT=ReallySuppress"') $i = $i + 20 ; INSTALLATIE Application Studiosoftware Access (60%) ProgressSet( $i, $i & " % (Installeren: Application Studiosoftware Access)") RunWait ($serverlocation & $installdir & $StudiosoftwareAccess & ' /s /v"/qb! REBOOT=ReallySuppress') $i = $i + 20 ProgressSet( $i, $i & " % (Installeren: Application Studiosoftware Assist)") ; INSTALLATIE Application Studiosoftware Assist (80%) AdlibEnable("WindowsDriverSigning") Func WindowsDriverSigning() If WinActive("Software-installatie", "De software die u installeert, voldoet niet aan de eisen van de Windows Logo-test, die op compatibiliteit met Windows XP controleert.") Then send ("!t") EndIf EndFunc RunWait ($serverlocation & $installdir & $StudiosoftwareAssist & ' /s /v"/qb! REBOOT=ReallySuppress') $i = $i + 3 AdlibDisable () ; Updating settings and registry ProgressSet( $i, $i & " % (Bijwerken: Register)") RunWait ("Regedit /s " & $serverlocation & $settingspath & "\Studiosoftware-settings.reg") $i = $i + 3 ProgressSet( $i, $i & " % (Bijwerken: Instellingen)") Filecopy ("C:\Documents and Settings\All Users\Menu Start\Programma's\ApplicationverenigNONO\ClientManager*.*", "C:\Documents and Settings\All Users\Bureaublad") $i = $i + 3 ProgressSet( $i, $i & " % (Bijwerken: Instellingen)") Filecopy ("C:\Documents and Settings\All Users\Menu Start\Programma's\Application\Application Studiosoftware Assist*.*", "C:\Documents and Settings\All Users\Bureaublad") $i = $i + 3 ProgressSet( $i, $i & " % (Verwijderen: Installatiebestanden)") if FileExists ("c:\Applicationinst") then Dirremove ("c:\Applicationinst", 1) endif ProgressSet(100 , "Voltooid", "Installatie van Application Studiosoftware is voltooid.") sleep(4000) ProgressOff() $answer = MsgBox(4100, "Installatie Application Studiosoftware voltooid", "De installatie van Application Studiosoftware is voltooid." & @cr & "De pc moet opnieuw worden opgestart voordat Application Studiosoftware kan worden gebruikt." & @cr & "Wilt u dit nu doen?") If $answer = 6 Then Shutdown (6) ElseIf $answer = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now