Jump to content

Read Logfile Of Installshield


Recommended Posts

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

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

#)

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...