Search the Community
Showing results for tags 'Not completed but works'.
-
Hi, This is a script I was working on a while ago but never finished, it's in a working state but needs a lot doing to it but I don't have the energy to put into it anymore Basically its a silent software installer which will be useful for people who reinstall windows a lot and have a software package they install as standard. The software I have included is AVG Panda Cloud Free OpenOffice Adobe Reader VLC Media Player Ashampoo Burning Studio 2013 Free Adobe Flash player Java The Ashampoo and panda currently dont run as silent installers as I cant find switches for them, also the openoffice includes the quickstarter which I couldn't seem to remove via a switch. I have added a custom tab if anyone wants to add their own software. (As a user not a dev) but some kind of feature will need creating for this. There is also a 'Clean on complete' button which will clean all event logs on vista and 7 once its installed the software (Batch file I found on the internet but cant remember where so credit to the unnamed scripter for this) and it also silently runs ccleaner with its predefined options. I have not yet implemented the cancel feature, I was thinking of using variables as flags which get checked before running each installer and if the cancel button has been pressed it sets the flag as 1 for example which will then skip the next install until it gets to the end (if you know what i mean)- I think this will be best way to do it as I wouldn't want to force close a currently installing piece of software. Also I'm not sure how it reacts to 'updating' software if an older version is already found, I havn't properly tested this on a non-clean machine yet. Also it used a settings ini file to remember the software selection everytime you open it, and there is an option in the gui to save your selection (updates the values in the ini which get read during open) Here is a screenshot of the main window... and here is the code for the main script - you can download the full package at the bottom of the post if you wish - its easy enough to read and I have commented each block of code so you can see it better, you probly see a few lines of commented code which didnt work out or i didnt get chance to finish #cs ---------------------------------------------------------------------------- Author: Aaron Marsh Application: Offline Silent Install App Version: 1 #ce ---------------------------------------------------------------------------- #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #RequireAdmin Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 1) msgbox(0,"","Cancel Feature not yet implemented") ;Variables Local $AVGINI, $PANDAINI, $OPENOFFICEINI, $ADOBEREADERINI, $VLCINI, $ASHAMPOOBURNINGFREEINI, $FLASHINI, $JAVAINI, $REBOOTINI, $CLEANINI, $VAREXITMENU = False Local $VARABOUT = False, $VARSAVE = False, $TASKRUNNING = False, $VARSTART Local $AVGRUNNING = False, $PANDARUNNING = False, $OPENOFFICERUNNING = False, $ADOBEREADERRUNNING = False, $VLCRUNNING = False, $ASHAMPOOBURNINGFREERUNNING = False Local $FLASHRUNNING = False, $JAVARUNNING = False Local $REGREADINSTALLATION, $INSTALLATIonprogress, $INSTALLATIONSTATE, $VARCANCEL ;Read VALUES OF INI FILE AND STORE AS VARIABLES HERE THEN CHECK STAtE OF VALUE AND SET CHKBOX VALUE DEPENDING On RESULT $AVGINI=IniRead("settings.ini", "SOFTWARE", "AVG","") $PANDAINI=IniRead("settings.ini", "SOFTWARE", "PANDA","") $OPENOFFICEINI=IniRead("settings.ini", "SOFTWARE", "OPENOFFICE","") $ADOBEREADERINI=IniRead("settings.ini", "SOFTWARE", "ADOBEREADER","") $VLCINI=IniRead("settings.ini", "SOFTWARE", "VLC","") $ASHAMPOOBURNINGFREEINI=IniRead("settings.ini", "SOFTWARE", "ASHAMPOOBURNINGFREE","") $FLASHINI=IniRead("settings.ini", "SOFTWARE", "FLASH","") $JAVAINI=IniRead("settings.ini", "SOFTWARE", "JAVA","") $REBOOTINI=IniRead("settings.ini", "OPTIONS", "REBOOT","") $CLEANINI=IniRead("settings.ini", "OPTIONS", "CLEAN","") ;Define Variables $DETECTEDOS = 0 $DETECTEDARCH = @OSArch $DETECTEDSP = @OSServicePack $OSVersion = @OSVersion ;Variables If $OSVersion = "WIN_7" Then $DETECTEDOS = "Windows 7" EndIf If $OSVersion = "WIN_VISTA" Then $DETECTEDOS = "Windows Vista" EndIf If $OSVersion = "WIN_XP" Then $DETECTEDOS = "Windows XP" EndIf If $OSVersion = "" Then $DETECTEDOS = "Other" EndIf If $DETECTEDOS = "Other" Then msgbox(0,"Warning","This software has not been tested with your version of Windows and may not work properly if you choose to continue") EndIf ;Main Gui $MAIN = GUICreate("Offline Silent Installer v1", 451, 417, -1, -1) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseApplication") ;FILE MENU $MenuItemFile = GUICtrlCreateMenu("File") $MenuSubItemSave = GUICtrlCreateMenuItem("Save", $MenuItemFile) GUICtrlSetOnEvent($MenuSubItemSave, "_Begin_Save_Function") $MenuSubItemExit = GUICtrlCreateMenuItem("Exit", $MenuItemFile) GUICtrlSetOnEvent($MenuSubItemExit, "_Begin_Close_Function") $MenuItemHelp = GUICtrlCreateMenu("Help") $MenuSubItemAbout = GUICtrlCreateMenuItem("About", $MenuItemHelp) GUICtrlSetOnEvent($MenuSubItemAbout, "_Begin_About_Function") $MenuSuItemHelp = GUICtrlCreateMenuItem("Help", $MenuItemHelp) ;Groups $GROUP_SYSTEMINFO = GUICtrlCreateGroup("System Info", 232, 40, 201, 89) $LABEL_OS = GUICtrlCreateLabel($DETECTEDOS, 248, 64, 87, 17) GUICtrlSetColor(-1, 0x0000FF) $LABEL_SYSTEMTYPE = GUICtrlCreateLabel($DETECTEDARCH, 248, 80, 65, 17) GUICtrlSetColor(-1, 0x0000FF) $LABEL_SP = GUICtrlCreateLabel($DETECTEDSP, 248, 96, 80, 17) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGroup("", -99, -99, 1, 1) $GROUP_OPTIONS = GUICtrlCreateGroup("Options", 16, 40, 201, 89) $CHKBOX_REBOOT = GUICtrlCreateCheckbox("Reboot", 32, 64, 65, 17) GUICtrlSetTip(-1, "Restarts computer when all installations have completed") If $REBOOTINI = 1 then GUICtrlSetState($CHKBOX_REBOOT, $GUI_CHECKED) EndIf $CHKBOX_CLEAN = GUICtrlCreateCheckbox("Clean on Completion", 32, 88, 129, 17) GUICtrlSetTip(-1, "Runs portable Ccleaner upon completion") If $CLEANINI = 1 then GUICtrlSetState($CHKBOX_CLEAN, $GUI_CHECKED) EndIf GUICtrlCreateGroup("", -99, -99, 1, 1) ;TabSheet $Tab1 = GUICtrlCreateTab(16, 152, 417, 193) $TabSheet1 = GUICtrlCreateTabItem("Security") $CHKBOX_AVG = GUICtrlCreateCheckbox("AVG Anti-Virus FREE 2012", 64, 200, 153, 17) $Pic1 = GUICtrlCreatePic("images\avg.jpg", 32, 192, 25, 25) If $AVGINI = 1 then GUICtrlSetState($CHKBOX_AVG, $GUI_CHECKED) EndIf $CHKBOX_PANDA = GUICtrlCreateCheckbox("Panda Cloud FREE", 64, 232, 145, 17) $Pic2 = GUICtrlCreatePic("images\panda.jpg", 32, 224, 25, 25) If $PANDAINI = 1 then GUICtrlSetState($CHKBOX_PANDA, $GUI_CHECKED) EndIf $TabSheet2 = GUICtrlCreateTabItem("Office") $CHKBOX_OPENOFFICE = GUICtrlCreateCheckbox("OpenOffice", 64, 200, 97, 17) $Pic3 = GUICtrlCreatePic("images\openoffice.jpg", 32, 192, 25, 25) If $OPENOFFICEINI = 1 then GUICtrlSetState($CHKBOX_OPENOFFICE, $GUI_CHECKED) EndIf $CHKBOX_ADOBEREADER = GUICtrlCreateCheckbox("Adobe Reader", 64, 232, 97, 17) $Pic4 = GUICtrlCreatePic("images\adobereader.jpg", 32, 227, 25, 25) If $ADOBEREADERINI = 1 then GUICtrlSetState($CHKBOX_ADOBEREADER, $GUI_CHECKED) EndIf $TabSheet3 = GUICtrlCreateTabItem("Media") $CHKBOX_VLC = GUICtrlCreateCheckbox("VLC Media Player", 64, 200, 137, 17) $Pic5 = GUICtrlCreatePic("images\vlc.jpg", 32, 192, 25, 25) If $VLCINI = 1 then GUICtrlSetState($CHKBOX_VLC, $GUI_CHECKED) EndIf $TabSheet4 = GUICtrlCreateTabItem("Burning") $CHKBOX_ASHAMPOO = GUICtrlCreateCheckbox("Ashampoo Burning Studio 2013 Free", 64, 200, 193, 17) $Pic6 = GUICtrlCreatePic("images\abs6.jpg", 32, 192, 25, 25) If $ASHAMPOOBURNINGFREEINI = 1 then GUICtrlSetState($CHKBOX_ASHAMPOO, $GUI_CHECKED) EndIf $TabSheet5 = GUICtrlCreateTabItem("Misc") $CHKBOX_FLASH = GUICtrlCreateCheckbox("Adobe Flash Player", 64, 200, 121, 17) $Pic7 = GUICtrlCreatePic("images\flash.jpg", 32, 192, 25, 25) If $FLASHINI = 1 then GUICtrlSetState($CHKBOX_FLASH, $GUI_CHECKED) EndIf $CHKBOX_JAVA = GUICtrlCreateCheckbox("Java", 64, 232, 97, 17) $Pic8 = GUICtrlCreatePic("images\java.jpg", 32, 224, 25, 25) If $JAVAINI = 1 then GUICtrlSetState($CHKBOX_JAVA, $GUI_CHECKED) EndIf $TabSheet6 = GUICtrlCreateTabItem("Custom") GUICtrlCreateTabItem("") GUICtrlSetState($TabSheet1,$GUI_SHOW) ;Bottom $BUTTON_INSTALL = GUICtrlCreateButton("Install", 344, 352, 91, 33) GUICtrlSetOnEvent($BUTTON_INSTALL, "_BeginStartInstall") $BUTTON_CANCEL = GUICtrlCreateButton("Cancel", 344, 352, 91, 33) GUICtrlSetState($BUTTON_CANCEL,$GUI_HIDE) GUICtrlSetOnEvent($BUTTON_CANCEL, "_BeginCancelInstall") $LABEL_CREATEDBY = GUICtrlCreateLabel("Created By Aaron Marsh", 16, 368, 150, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) While 1 Sleep(0) If $VARSTART Then $VARSTART = False _StartInstall() EndIf If $VARCANCEL Then $VARCANCEL = False _CancelInstall() EndIf If $VAREXITMENU Then $VAREXITMENU = False _Exit_Command() EndIf If $VARABOUT Then $VARABOUT = False MsgBox(64, "About", "Offline Silent Software Installer v1" & @CRLF & @CRLF & "Created By:" & " Aaron Marsh" & @CRLF & @CRLF & "12 April 2013") EndIf If $VARSAVE Then $VARSAVE = False ;AVG If GUICtrlRead($CHKBOX_AVG) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "AVG", 1) Else IniWrite("settings.ini", "SOFTWARE", "AVG", 0) EndIf ;PANDA If GUICtrlRead($CHKBOX_PANDA) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "PANDA", 1) Else IniWrite("settings.ini", "SOFTWARE", "PANDA", 0) EndIf ;OPENOFFICE If GUICtrlRead($CHKBOX_OPENOFFICE) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "OPENOFFICE", 1) Else IniWrite("settings.ini", "SOFTWARE", "OPENOFFICE", 0) EndIf ;ADOBEREADER If GUICtrlRead($CHKBOX_ADOBEREADER) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "ADOBEREADER", 1) Else IniWrite("settings.ini", "SOFTWARE", "ADOBEREADER", 0) EndIf ;VLC If GUICtrlRead($CHKBOX_VLC) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "VLC", 1) Else IniWrite("settings.ini", "SOFTWARE", "VLC", 0) EndIf ;ASHAMPOO 2013 FREE If GUICtrlRead($CHKBOX_ASHAMPOO) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "ASHAMPOOBURNINGFREE", 1) Else IniWrite("settings.ini", "SOFTWARE", "ASHAMPOOBURNINGFREE", 0) EndIf ;FLASH If GUICtrlRead($CHKBOX_FLASH) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "FLASH", 1) Else IniWrite("settings.ini", "SOFTWARE", "FLASH", 0) EndIf ;JAVA If GUICtrlRead($CHKBOX_JAVA) = $GUI_CHECKED Then IniWrite("settings.ini", "SOFTWARE", "JAVA", 1) Else IniWrite("settings.ini", "SOFTWARE", "JAVA", 0) EndIf ;REBOOT If GUICtrlRead($CHKBOX_REBOOT) = $GUI_CHECKED Then IniWrite("settings.ini", "OPTIONS", "REBOOT", 1) Else IniWrite("settings.ini", "OPTIONS", "REBOOT", 0) EndIf ;CLEAN If GUICtrlRead($CHKBOX_CLEAN) = $GUI_CHECKED Then IniWrite("settings.ini", "OPTIONS", "CLEAN", 1) Else IniWrite("settings.ini", "OPTIONS", "CLEAN", 0) EndIf EndIf ;_CheckIfInstallInProgress() WEnd ;Functions Func _Begin_Close_Function() $VAREXITMENU = True EndFunc Func _Begin_About_Function() $VARABOUT = True EndFunc Func _Begin_Save_Function() $VARSAVE = True EndFunc Func _BeginStartInstall() $VARSTART = True EndFunc Func _BeginCancelInstall() $VARCANCEL = True EndFunc Func _CloseApplication() If @GUI_CTRLID = $GUI_EVENT_CLOSE Then _Exit_Command() EndFunc Func _Exit_Command() If $TASKRUNNING = True Then $msgboxquitvalue = MsgBox(52,"Warning!","Are you sure you want to quit while an install is in progress?") If $msgboxquitvalue = 6 then ;Check if an install is currently running for specific program and wait until finished If $AVGRUNNING = True then ProcessWaitClose("AVGSilent.exe") Exit EndIf If $PANDARUNNING = True then ProcessWaitClose("CloudAntivirus") Exit EndIf If $OPENOFFICERUNNING = True then ProcessWaitClose("OpenOfficeSilent.exe") Exit EndIf If $ADOBEREADERRUNNING = True then ProcessWaitClose("AdobeReaderSilent.exe") Exit EndIf If $VLCRUNNING = True then ProcessWaitClose("VLCSilent.exe") Exit EndIf If $ASHAMPOOBURNINGFREERUNNING = True then ProcessWaitClose("ashampoo_burning_studio_2013_11.0.5_12469.exe") Exit EndIf If $FLASHRUNNING = True then ProcessWaitClose("FlashPlayerSilent.exe") Exit EndIf If $JAVARUNNING = True then ProcessWaitClose("JavaSilent.exe") Exit EndIf EndIf EndIf If $TASKRUNNING = False then Exit EndIf EndFunc ;Func _CancelInstall() ;If $TASKRUNNING = True Then ; $msgboxquitvalue = MsgBox(52,"Warning!","Are you sure you want to cancel while an install is in progress?") ;If $msgboxquitvalue = 6 then ;Check if an install is currently running for specific program and wait until finished ;If $AVGRUNNING = True then ; ProcessWaitClose("AVGSilent.exe") ; Exit ;EndIf ;If $PANDARUNNING = True then ; ProcessWaitClose("CloudAntivirus") ; Exit ;EndIf ;If $OPENOFFICERUNNING = True then ; ProcessWaitClose("OpenOfficeSilent.exe") ; Exit ;EndIf ;If $ADOBEREADERRUNNING = True then ; ProcessWaitClose("AdobeReaderSilent.exe") ; Exit ;EndIf ;If $VLCRUNNING = True then ; ProcessWaitClose("VLCSilent.exe") ; Exit ;EndIf ;If $ASHAMPOOBURNINGFREERUNNING = True then ; ProcessWaitClose("ashampoo_burning_studio_2013_11.0.5_12469.exe") ; Exit ;EndIf ;If $FLASHRUNNING = True then ; ProcessWaitClose("FlashPlayerSilent.exe") ; Exit ;EndIf ;If $JAVARUNNING = True then ; ProcessWaitClose("JavaSilent.exe") ; Exit ;EndIf ;EndIf ;EndIf ;If $TASKRUNNING = False then ; Exit ;EndIf ;EndFunc Func _StartInstall() $TASKRUNNING = True GUICtrlSetState($BUTTON_INSTALL,$GUI_HIDE) GUICtrlSetState($BUTTON_CANCEL,$GUI_SHOW) ;Security ;AVG If GUICtrlRead($CHKBOX_AVG) = $GUI_CHECKED Then $AVGRUNNING = True SplashTextOn("Installing Software...","AVG 2013 Free Edition","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\AVG\AVGSilent.exe") SplashOff() $AVGRUNNING = False EndIf ;Panda NOT YET SILENT If GUICtrlRead($CHKBOX_PANDA) = $GUI_CHECKED Then $PANDARUNNING = True SplashTextOn("Installing Software...","Panda Cloud Antivirus","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\Panda\CloudAntivirus.exe") SplashOff() $PANDARUNNING = False EndIf ;Office ;OpenOffice If GUICtrlRead($CHKBOX_OPENOFFICE) = $GUI_CHECKED Then $OPENOFFICERUNNING = True SplashTextOn("Installing Software...","OpenOffice 3.4.1","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\OpenOffice\OpenOfficeSilent.exe") SplashOff() $OPENOFFICERUNNING = False EndIf ;Adobe Reader If GUICtrlRead($CHKBOX_ADOBEREADER) = $GUI_CHECKED Then $ADOBEREADERRUNNING = True SplashTextOn("Installing Software...","Adobe Reader XI","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\AdobeReader\AdobeReaderSilent.exe") SplashOff() $ADOBEREADERRUNNING = False EndIf ;Media ;VLC Player If GUICtrlRead($CHKBOX_VLC) = $GUI_CHECKED Then $VLCRUNNING = True SplashTextOn("Installing Software...","VLC Media Player","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\VLC\VLCSilent.exe") SplashOff() $VLCRUNNING = False EndIf ;Burning ;Ashampoo Burning Studio 2013 If GUICtrlRead($CHKBOX_ASHAMPOO) = $GUI_CHECKED Then $ASHAMPOOBURNINGFREERUNNING = True SplashTextOn("Installing Software...","Ashampoo Burning Studio 2013 Free","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\AshampooBurning2013\ashampoo_burning_studio_2013_11.0.5_12469.exe") SplashOff() $ASHAMPOOBURNINGFREERUNNING = False EndIf ;Misc ;Flash Player If GUICtrlRead($CHKBOX_FLASH) = $GUI_CHECKED Then $FLASHRUNNING = True SplashTextOn("Installing Software...","Adobe Flash Player","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\Flash\FlashPlayerSilent.exe") SplashOff() $FLASHRUNNING = False EndIf ;Java If GUICtrlRead($CHKBOX_JAVA) = $GUI_CHECKED Then $JAVARUNNING = True SplashTextOn("Installing Software...","Java","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\Java\JavaSilent.exe") SplashOff() $JAVARUNNING = False EndIf ;Options ;Clean If GUICtrlRead($CHKBOX_CLEAN) = $GUI_CHECKED Then FileCopy(@ScriptDir & "\exes\cleanup\Clear_All_Logs.bat", @TempDir, 1) SplashTextOn("Please Wait...","Cleaning Temp Files","300","50","-1","-1",32,"","","") RunWait(@ScriptDir & "\exes\cleanup\ccsetup327\CCleanerPortable.exe") SplashOff() ;Clear All Logs (NOT MY BATCH SCRIPT - FOUND ON THE INTERNET BUT CANT REMEMBER WHERE SO CREDIT DUE HERE TO THE UNNAMED SCRIPTER :) If $OSVersion = "WIN_7" Then SplashTextOn("Please Wait...","Cleaning Event Logs","300","50","-1","-1",32,"","","") RunWait(@TempDir & "\Clear_All_Logs.bat","",@SW_HIDE) SplashOff() EndIf If $OSVersion = "WIN_VISTA" Then SplashTextOn("Please Wait...","Cleaning Event Logs","300","50","-1","-1",32,"","","") RunWait(@TempDir & "\Clear_All_Logs.bat","",@SW_HIDE) SplashOff() EndIf FileDelete(@TempDir & "\Clear_All_Logs.bat") EndIf $TASKRUNNING = False GUICtrlSetState($BUTTON_CANCEL,$GUI_HIDE) GUICtrlSetState($BUTTON_INSTALL,$GUI_SHOW) EndFunc Each silent installer is its own executable so that if you want to just update 1 bit of software you dont have to recompile the main exe each time. I did it like this because I was thinking of like a plugin system where a user can add their own software package without needing to be hard-coded into the main executable I wanted to share the project as I think someone else can make it better and add more features, also im not sure about the best way to go about adding support for custom packages. I hope its of use to people and it will be good if anyone wants to contribute to the project. Here is the download for the complete package which includes the code and precompiled exe's, images used in the gui, and the form file for koda, here is also a second download which has all the above and includes all the software exe's aswell. http://www.backuputility.co.uk/SoftwareInstaller.zip other download is just uploading to mega as we speak Hope to hear and see what progress anyone can make from it Thanks