Jump to content

Run script works but after compile not working


Recommended Posts

Dear forum;

I have problem with my script. Running and compiling with small exe files and msi files is working perfectly.

Running bigger files is working too, when I use them once. But when I try to change something on script, or make a new script with the same bigger file, compiling is working, but running after compiling failes.

I have searched all forum and saw more problems after compiling. But my script has no problems with compiling. Only when I use bigger files. As example a file of 292 mb to install.

I have my script included. I hope someone can help me. Thank you very much.

#NoTrayIcon
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=favicon.ico                                            ;Filename of the Ico file to use
#AutoIt3Wrapper_UseUpx=y                                                    ;(Y/N) Compress output program.  Default=Y
#AutoIt3Wrapper_Res_Comment=Name Unattendeds 2020
#AutoIt3Wrapper_Res_Description=Name Unattendeds 2020
#AutoIt3Wrapper_Res_LegalCopyright=@Name 2020
#AutoIt3Wrapper_Res_Language=1043
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Compression=0                                               ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiStatusbar.au3>
#include <File.au3>
; Local include.
#include "_GUIResourcePic.au3"

#cs
    ;----> State
    $GUI_GIFSTART           ; If image is GIF animated, start/resume animation!
    $GUI_GIFSTOP            ; If image is GIF animated, stop/pause animation!
    ;----> Style (GIS = Gif Image Styles)
    $GIS_ASPECTRATIOFIX     ; Fix the image size based on aspect ratio.
    $GIS_HALFTRANSPARENCY   ; The images are rendered with the window background color. This Style is default.
    $GIS_FULLTRANSPARENCY   ; The frames are rendered in full transparency independent of the background color of the window!
    ;                           Note: This Style consumes more CPU because the exstyle $WS_EX_TRANSPARENT is added to each frame in real time!
    ;                           Not valid if the image does not have transparency!
    ;----> Default Style to _GUICtrlPic_Create()!
    $GIS_SS_DEFAULT_PIC = BitOR($GIS_HALFTRANSPARENCY, $SS_NOTIFY)
    ;----> ExStyle (GIS_EX = Gif Image Extended Styles)
    $GIS_EX_DEFAULTRENDER   ; To use _GUIImageList_Draw in rendering of images, use less CPU. This ExStyle is default!
    $GIS_EX_CTRLSNDRENDER   ; The frames is render using GUICtrlSendMsg, but consumes much more CPU!!!
    ;                           Note: If you use this ExStyle, only $GRP_FULLTRANSPARENCY is used for rendering images!
#ce


            Opt("TrayIconHide", 1)
            Opt("TrayAutoPause", 0)
            Opt("TrayIconDebug", 0)
            Opt("SendKeyDelay", 50)

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

            Sleep(200)

            ProcessClose("MSIBuilder.exe")
            ProcessClose("Setup Capture.exe")
            ProcessClose("Au3Record.exe")
            ProcessClose("Au3Record_x64.exe")
            ProcessClose("taskmgr.exe")
            ProcessClose("advinst.exe")

            Local $sfldr1 = "C:\Windows\Temp\Install\"
            DirCreate($sfldr1)

            Sleep(2000)

            FileSetAttrib ( $sFldr1, "+SH")

            Sleep(2000)


;Verander "Sjabloon" in naam uaa programma
$GUI = GUICreate("Voorbeeld", 600, 225)
_GUICtrlPic_Create(".\Resources\Bitmap\banner.jpg", -1, -1, -1, -1, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW)

$status = _GUICtrlStatusBar_Create($GUI)

_guictrlstatusbar_settext($status, @TAB & "Verzamelen van gegevens wordt voorbereid...")

            Sleep(2000) ; sleep 20 seconds

            ;Door jouw gemaakte install.cmd

            FileInstall(".\Voorbeeld.msi", $sfldr1 & "\Voorbeeld.msi", 1)
            FileInstall(".\FirewallVoorbeeld.exe", $sfldr1 & "\FirewallVoorbeeld.exe")

            Sleep(2000)

_guictrlstatusbar_settext($status, @TAB & "Start installatie software. (Laat de computer even met rust. . . . ! !)")

            Sleep(2000) ; sleep 20 seconds

            RunWait(@ComSpec & " /C " & "Voorbeeld.msi /qn", "C:\Windows\Temp\Install\", @SW_HIDE) ;MSI installatie Silent
            RunWait(@ComSpec & " /C " & "FirewallVoorbeeld.exe", "C:\Windows\Temp\Install\", @SW_HIDE)


            Sleep (500) ; sleep 5 seconds


            Sleep(2000)

            PROCESSCLOSE("firefox.exe")
            PROCESSCLOSE("iexplore.exe")
            PROCESSCLOSE("chrome.exe")
            PROCESSCLOSE("MicrosoftEdge.exe")

            Sleep(2000) ; sleep 20 seconds

_guictrlstatusbar_settext($status, @TAB & "Verwerking software is bijna voltooid...")

            Sleep(2000) ; sleep 20 seconds

_guictrlstatusbar_settext($status, @TAB & "Installatie software is voltooid....Veel Plezier, Name....")

            Sleep(2000) ; sleep 20 seconds

            DirRemove($sfldr1, 1)

            Sleep(4000)

ScriptVoorbeeld.au3

Edited by Jos
Added script source inline
Link to comment
Share on other sites

  • Developers

Are you sure the compiled file contains the large file?
What is going wrong when you run the compiled script?:

  • Does it extract the included MSI to the $sfldr1 directory?
  • Does it give any error?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

2 minutes ago, Kajoe said:

Hi Jos;

Thank you for your quick reply.

It is given no error at all. With syntaxcheckprod it gives no problems too. I see extraction in the $sfldr1 directory. But only with run script. 

Compiled exe file is only thinking a while but not starting. 

 

Link to comment
Share on other sites

  • Developers

Ok...  so why didn't you include the path in the RunWait() statements?
.. and there is not error checking for any task in your current script. I would advice you to implement that and possibly log steps & results to a logfile. 
Try (as test) to modify them to:

RunWait(@ComSpec & " /k " & $sfldr1 & "\Voorbeeld.msi /qn", "C:\Windows\Temp\Install\", @SW_show)

This will leve the CMD prompt open en shows any errors in case there are any.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi Jos;

I have modified my RunWait files as you mentioned above. During Test Run I see the CMD screen. It shows on both installations text ; "C:\Windows\Temp\Install>"
Test run installs programs correctly, but after compiling the compiled file is not working. Shows nothing at all.

Link to comment
Share on other sites

Hi Jos;

When I remove the large file from script and compile, than compiled file is running without problems. During running compiled file (with the small exe file in it) I can see the CMD screen too and this shows the same as with run test.  It only happens with big files.

Link to comment
Share on other sites

  • Developers

So with the large file you do not see any CMD window popping up at run time?
Did you check whether the extracted MSI is valid after you run this compiled script? 
Could it be that an Anti Virus program is screwing with your Script either at compile time or at execution time? (the latter sound most likely)

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

 

1 minute ago, Kajoe said:

I have disabled upx compression. Now script is working. Is there a solution for upx compression?

Yes. ...  Never use it! 
It doesn't buy you anything, especially when you attach large installer in the PE header!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...