Bernd Braun Posted May 3, 2006 Share Posted May 3, 2006 Dear to install different software which depend on each other: #Installation of UG NX4 with error control #Read Registry UGII_BASE_DIR, UGII_Root_DIR and bct_eoms_dir $UGIIBASE_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_BASE_DIR") $UGII_Root_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_Root_DIR") $BCT_EOMS_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "BCT_EOMS_DIR") #start installation Installshield Scrip engine Runwait (@SystemDir & "msiexec.exe /i" & "\\Dsmaster\DATEN\SERVICE\zenappl\UG\nx4\ISScript10.Msi" & " /qn /li c:\gb\ugnx4scriptenginel.log") $file = FileOpen("c:\gb\ugnx4scriptenginel.log", 0) ; Read in file at a time until the EOF is reached $var = FileRead("c:\gb\ugnx4scriptenginel.log") for $i = 0 to $var[0] if StringInStr($var[$i], "Installation operation completed successfully") then Do next installation and so on .... EndIf Next FileClose($file) The Result of the fileread is complete different than that what is expected. The file is not read in the right way. In Notepad everything can be read fine ! Link to comment Share on other sites More sharing options...
nfwu Posted May 3, 2006 Share Posted May 3, 2006 You look as if you have used batch files before... Ok, back to your problem. ;;Installation of UG NX4 with error control ;;Read Registry UGII_BASE_DIR, UGII_Root_DIR and bct_eoms_dir $UGIIBASE_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_BASE_DIR") $UGII_Root_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_Root_DIR") $BCT_EOMS_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "BCT_EOMS_DIR") ;;start installation Installshield Scrip engine Runwait (@SystemDir & "msiexec.exe /i" & "\\Dsmaster\DATEN\SERVICE\zenappl\UG\nx4\ISScript10.Msi" & " /qn /li c:\gb\ugnx4scriptenginel.log") $sFile = "c:\gb\ugnx4scriptenginel.log" $var = FileRead($sFile, FileGetSize($sFile));;Read the whole file in one shot... if StringInStr($var, "Installation operation completed successfully") then ;;OK else ;;NOT OK MSGBOX(0, "error", "error") Exit;;Quit endif #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Bernd Braun Posted May 3, 2006 Author Share Posted May 3, 2006 You look as if you have used batch files before... Ok, back to your problem. ;;Installation of UG NX4 with error control ;;Read Registry UGII_BASE_DIR, UGII_Root_DIR and bct_eoms_dir $UGIIBASE_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_BASE_DIR") $UGII_Root_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "UGII_Root_DIR") $BCT_EOMS_DIR = RegRead ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "BCT_EOMS_DIR") ;;start installation Installshield Scrip engine Runwait (@SystemDir & "msiexec.exe /i" & "\\Dsmaster\DATEN\SERVICE\zenappl\UG\nx4\ISScript10.Msi" & " /qn /li c:\gb\ugnx4scriptenginel.log") $sFile = "c:\gb\ugnx4scriptenginel.log" $var = FileRead($sFile, FileGetSize($sFile));;Read the whole file in one shot... if StringInStr($var, "Installation operation completed successfully") then ;;OK else ;;NOT OK MSGBOX(0, "error", "error") Exit;;Quit endif #) Your right - I start with batch scripts! But reading the is the problem - it don't read the file the right way. The result is something like (see attachment) Link to comment Share on other sites More sharing options...
nfwu Posted May 3, 2006 Share Posted May 3, 2006 Was that message box using my script, or your script? TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Bernd Braun Posted May 3, 2006 Author Share Posted May 3, 2006 Your script give the message box result "Error" ! Link to comment Share on other sites More sharing options...
Bernd Braun Posted May 3, 2006 Author Share Posted May 3, 2006 Your script give the message box result "Error" !Here I have attached the log-file !ugnx4scriptenginel.txt 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