ur Posted July 25, 2016 Posted July 25, 2016 I have written a script to build the Installshield project file(.ism) to setup files(.msi or .exe based on the release settings..). So when the user runs the script the process will be automatic for multiple ism files. Func Build($sOutputIsm,$ReleaseName,$sFilePath="None",$NewName="None") ;build the ism to get the msi If not FileExists($sOutputIsm) Then Logging("File Not Found: $sOutputIsm$",4) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not find file ""$sOutputIsm$"".") Return EndIf Logging("Started Building $sOutputIsm$",4) ShowTrayTip($AppName, "Started Building $sOutputIsm$", 10, $TIP_ICONASTERISK) Dim $sBuildExe,$sBuildCommand,$Ret $sBuildExe = FindFileInPath("ISCmdBld.exe", "%ProgramFiles(x86)%\InstallShield") $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" -s" ;MsgBox(0,"",$sBuildCommand) $Ret = RunWait($sBuildCommand) If $Ret <> 0 Then ShowTrayTip($AppName,"ISM Build Failed, Please build the ISM Manually.",10, $TIP_ICONHAND) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not build ""$sOutputIsm$"". Please build manually.") Logging("Error $Ret$ while Building $sOutputIsm$",4) Return;Exit(1) Else ShowTrayTip($AppName,"ISM Build Completed",10, $TIP_ICONASTERISK) Logging("Completed Building $sOutputIsm$",4) if not StringCompare($NewName, "None")=0 then MoveEXE($sFilePath,$NewName) EndIf EndFunc The problem is when we run the ISCmdBuild.exe the RunWait will give whether fail or success but not what are the errors we got. If we use Run, it will give that logging but we don't have the feature of getting fail/success as RunWait. If we run the above code by removing -s and using redirection operator > to a file, it is running manually but failing with autoit. Like $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" > c:\logs\uday.log" Any help on this?? And also, in some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered. Any suggestion on this too??
TheDcoder Posted July 26, 2016 Posted July 26, 2016 If you want to capture both the Exit Code and the Console Output, you would have to do some tricky things. Luckily I have made a UDF for that , Try my Process UDF . ur 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
ur Posted July 26, 2016 Author Posted July 26, 2016 3 hours ago, TheDcoder said: If you want to capture both the Exit Code and the Console Output, you would have to do some tricky things. Luckily I have made a UDF for that , Try my Process UDF . Thank you very much TheDcoder....
TheDcoder Posted July 26, 2016 Posted July 26, 2016 My pleasure @ur EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
ur Posted July 26, 2016 Author Posted July 26, 2016 22 minutes ago, TheDcoder said: My pleasure @ur Any suggestion for the second issue mentioned too. In some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered.
TheDcoder Posted July 26, 2016 Posted July 26, 2016 31 minutes ago, ur said: In some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered. Hmm... I can't help you with such issue as I don't use InstallShield. Try contacting InstallShield support regarding this issue. ur 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
ur Posted September 26, 2016 Author Posted September 26, 2016 Hi @TheDcoder I have been using the method mentioned by you to log the info and also to track the error code.It is working fine. But it is logging the output at the end of the process execution. Whereas now a days, the installshield building is taking around 2 hours and even more and it is failing at the end. Could you please suggest anything so that it would write the log data since the start of process instead of making it available only at the end.As the command line output of installshield is available form the execution start itself.
TheDcoder Posted September 28, 2016 Posted September 28, 2016 On 26/9/2016 at 4:22 PM, ur said: Could you please suggest anything so that it would write the log data since the start of process instead of making it available only at the end.As the command line output of installshield is available form the execution start itself. There are 2 ways you can use my UDF. The 1st is the simplest which returns the Exit Code + Output at the end, The 2nd one is more hard to do but with it you will be able to get the output from the start of the process! The 2nd method is demonstrated in the example script, its the part where you see live output from tracert google.com , you can study the code and check the documentation for more information . EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
ur Posted October 3, 2016 Author Posted October 3, 2016 (edited) But I didn't get documentation there.Generally where can I check any existing UDF repositories and its use and documentation? Edited October 3, 2016 by ur
TheDcoder Posted October 3, 2016 Posted October 3, 2016 4 hours ago, ur said: Generally where can I check any existing UDF repositories and its use and documentation? There is no repository for UDFs, you have to just download the .au3 scripts from the web and read them in SciTE, that's the only way EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
AutoBert Posted October 3, 2016 Posted October 3, 2016 1 hour ago, TheDcoder said: There is no repository for UDFs, you have to just download the .au3 scripts from the web and read them in SciTE, that's the only way That's the normal case, just reading function headers. Best case are demostrated by: @water his excel.au3 and word.au3 are documented (as they are meanwhile standard udfs in autoit-helfile) @FastFrench his fastfind.au3 comes with a standalone .chm helpfile @stilgar (Thorsten Willert) he has documented his ff.au3: http://german.documentation.ff-au3.thorsten-willert.de (only german in the moment) and i'm sure there are some more well documented udfs available.
ur Posted December 19, 2016 Author Posted December 19, 2016 On 9/28/2016 at 2:27 PM, TheDcoder said: There are 2 ways you can use my UDF. The 1st is the simplest which returns the Exit Code + Output at the end, The 2nd one is more hard to do but with it you will be able to get the output from the start of the process! The 2nd method is demonstrated in the example script, its the part where you see live output from tracert google.com , you can study the code and check the documentation for more information . The second method is displaying the output on a window. Is there any way to redirect the output to a file during the execution instead of end of execution.
TheDcoder Posted December 19, 2016 Posted December 19, 2016 (edited) 6 hours ago, ur said: Is there any way to redirect the output to a file during the execution instead of end of execution. Yes, just look at my code which redirects the output to the GUI. This part (highlighted) is what you need to study and understand . Edited December 19, 2016 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
ur Posted December 19, 2016 Author Posted December 19, 2016 Yeah got that...thanks TheDcoder. Added this function in the UDF file for this purpose. Func Logging($sMessage,$sLogFile=@TempDir&"\Logging_Runtime.log") FileWrite($sLogFile,$sMessage&@CRLF) EndFunc Func _Process_DebugLogRunCommand($hProcessHandle, $iPID) Local $sOutput = "", $sPartialOutput = "" ; Declare the output variable While ProcessExists($iPID) ; Loop until the process finishes $sPartialOutput = StdoutRead($iPID) ; Record the output ;$sOutput &= $sPartialOutput Logging($sPartialOutput) Sleep(1000) ; Don't kill the CPU WEnd $sPartialOutput = StdoutRead($iPID) ; Record the output Logging($sPartialOutput) ;$sOutput &= $sPartialOutput Local $iExitCode = _Process_GetExitCode($hProcessHandle) Logging(@CRLF & @CRLF & "Debug Complete! The Exit Code was: " & $iExitCode) ; Display the exit code Return $iExitCode ;Return SetExtended($iExitCode, $sOutput) ; Return True EndFunc
TheDcoder Posted December 19, 2016 Posted December 19, 2016 That was a very quick adoption of my code @ur . ur 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
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