#cs -------------------------------------Program with computer restart logic------------------------------------- This particular ISO creates a shortcut during installation. First check if the shortcut (.lnk) file is present in the start menu programs. If it is not present, then the software needs to be installed. Call _prereboot to install. _RunOnce() has the registry function RegWrite() to re-call the script on reboot. After reboot, _postreboot function opens up the software. -------------------------------------------------------------------------------------------------------------- #ce If not FileExists(@StartMenuDir & '\Programs\Corbis\FDR.lnk') Then _prereboot() Else _postreboot() EndIf func _prereboot() Sleep(5000) Run("D:\autorun\autorun.exe", "D:\") WinWaitActive("", "&Continue") Send("!c") WinWaitActive("FDR Setup") Send("{ENTER}") WinWaitActive("Read Me") Send("{ENTER}") WinWaitActive("Welcome!") Send("{TAB}{ENTER}") WinWaitActive("Run Program") Send("{TAB}{ENTER}") #cs The following script changes settings in the System Control Panel option in order to get around the "requires 3MB of virtual memory" error message #ce ShellExecute("Control.exe", "C:\WINDOWS\System32\sysdm.cpl") WinWait("System Properties") ControlCommand("System Properties", "General", "SysTabControl321", "TabRight") ControlCommand("System Properties", "Computer Name", "SysTabControl321", "TabRight") ControlCommand("System Properties", "Hardware", "SysTabControl321", "TabRight") WinWait("System Properties", "Advanced") ControlClick("System Properties", "Advanced", "Button2") WinWait("Performance Options", "Visual Effects") ControlCommand("Performance Options", "Visual Effects", "SysTabControl321", "TabRight") WinWait("Performance Options", "Advanced") ControlClick("Performance Options", "Advanced", "Button8") WinWait("Virtual Memory") ControlCommand("Virtual Memory", "", "Button4", "Check") ControlClick("Virtual Memory", "", "Button5") ControlClick("Virtual Memory", "", "Button7") WinWait("System Control Panel Applet", "", 2) ControlClick("System Control Panel Applet", "", "Button1") WinWaitClose("System Control Panel Applet") ControlClick("Performance Options", "Advanced", "Button11") ControlClick("Performance Options", "Advanced", "Button9") WinWaitClose("Performance Options", "Advanced") ControlClick("System Properties", "Advanced", "Button9") _RunOnce() Send("!y") EndFunc Func _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc func _postreboot() Sleep(8000) ;$var1 = ' /c title Launch && start "" "' ;$var2 = '\Programs\CORBIS\FDR.lnk"' #cs Enter the full path of the directory you want to open here, excluding the final backslash. #ce Local $path = "D:\" #cs Enter the name of the directory you wish to open here. #ce Local $dir = "FDR (D:)" #cs Enter the name of the file you wish to run in the directory here. #ce Local $file_name = "FDR95.EXE" #cs This portion of the script opens the directory your file is in, finds your file, and opens its properties. #ce ShellExecute("Explorer.exe", $path, "", "", @SW_HIDE) WinWait($dir) Local $index = ControlListView($dir, "", "SysListView321", "FindItem", $file_name) ControlListView($dir, "", "SysListView321", "Select", $index) ControlSend($dir, "", "SysListView321", "{ALTDOWN}{ENTER}{ALTUP}", 0) WinClose($dir) #cs This portion of the code changes whatever properties you want. Right now it changes the compatibility mode to Windows 95 and enables it. #ce Local $properties = StringFormat("%s Properties", $file_name) WinWait($properties) ControlCommand($properties, "", "SysTabControl321", "TabRight") WinWait($properties, "Version") ControlCommand($properties, "", "SysTabControl321", "TabRight") WinWait($properties, "Compatibility") WinActivate($properties) Send("{TAB}{SPACE}") ControlClick($properties, "", "Button11") ControlClick($properties, "", "Button9") Run("D:\FDR95.EXE") ;run(@ComSpec & $var1 & @StartMenuDir & $var2 , @StartMenuDir, @SW_MINIMIZE) EndFunc