
Dummiesman
Members-
Posts
14 -
Joined
-
Last visited
Dummiesman's Achievements

Seeker (1/7)
0
Reputation
-
#include <GUIConstants.au3> #include <GuiButton.au3> $Form1 = GUICreate("Digitally Sign EXE", 300, 70) $Input1 = GUICtrlCreateInput("Select File to Digitally Sign", 10, 10, 280, 21) $Browse = GUICtrlCreateButton("Browse...", 10, 35, 64, 25, $BS_DEFPUSHBUTTON) $do = GUICtrlCreateButton("Continue", 95, 35, 97, 25, $BS_DEFPUSHBUTTON) $Exit = GUICtrlCreateButton("Exit", 214, 35, 75, 25, $BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $Exit Exit Case $nMsg = $Browse $txt=FileOpenDialog("Open", "C:\","All (*.*)") GUICtrlSetData($Input1,$txt) Case $nMsg = $do $SelectedFile = GUICtrlRead($Input1) $Cert = "Certificate Name Here" $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $oSigner = ObjCreate("Scripting.Signer") $oSigner.SignFile($SelectedFile, $Cert) If @error then exit $oSigner = "" $oMyError = "" Msgbox(0,"Signed", "Signing is complete") GUICtrlSetData($Input1, "") EndSelect WEnd Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "AutoItCOM", "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) EndFunc I figured it would be something simple like that. I added that after the Msgbox and added: $oMyError = "" above msgbox and it is doing what I want Thanks! Final code:
-
My cert is a company issues code signing cert and to use it you must have a password to complete the process. I'm hoping you will get the error but be able to tell me how to keep the window open ready to do another.
-
Lets try this. Remove the whole MyErrFunc() and line 23 ($oMyError = ObjEvent("AutoIt.Error", "MyErrFunc"). Open IE and go to Internet Options>Content>Certificates and find a name under the Issued To column. Put that name in line 22 in the quotes. Thanks for trying.
-
Using scripts from this forum (many thanks by the way) I have created a simple GUI that lets me browse to a file and upon clicking Continue the file is digitally signed with a hard coded certificate. Then the GUI closes. Works fine. I would however like to keep the GUI and ready to do another once it completes one. I have tried to google this but doubt I am using the correct phrase as I have had no luck even coming close. Could someone point me in the right direction please? Thank you.#include <GUIConstants.au3> #include <GuiButton.au3> $Form1 = GUICreate("Digitally Sign EXE", 300, 70) $Input1 = GUICtrlCreateInput("Select File to Digitally Sign", 10, 10, 280, 21) $Browse = GUICtrlCreateButton("Browse...", 10, 35, 64, 25, $BS_DEFPUSHBUTTON) $do = GUICtrlCreateButton("Continue", 95, 35, 97, 25, $BS_DEFPUSHBUTTON) $Exit = GUICtrlCreateButton("Exit", 214, 35, 75, 25, $BS_DEFPUSHBUTTON) ;$Label1 = GUICtrlCreateLabel(" ", 10, 10) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $Exit Exit Case $nMsg = $Browse $txt=FileOpenDialog("Open", "C:\","All (*.*)") GUICtrlSetData($Input1,$txt) Case $nMsg = $do $SelectedFile = GUICtrlRead($Input1) $Cert = "Certificate Name Here" $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $oSigner = ObjCreate("Scripting.Signer") $oSigner.SignFile($SelectedFile, $Cert) $oSigner = "" Msgbox(0,"Signed", "Signing is complete") EndSelect WEnd Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) EndFunc ;==>MyErrFunc
-
I broke it into 15 variables because when I did CTRL+F5 to check the code I kept getting "yacc stack overflow" errors after around 250 lines.
-
I probably should show what I have in case you see a mistake or have a suggestion of a better way. $parent = GUICreate("Office 2010 ProPlus is Installing",350,450,50,50,$WS_CAPTION) GUISetBkColor(0x99cccc) GUISetFont(10,650) GUICtrlCreateLabel(" Upgrade began on " & @YEAR & "/" & @MON & "/" & @MDAY & " at " & @HOUR & ":" & @MIN & " ", 0, 30, 350, 25) GUICtrlSetFont(-1,10,650) GUICtrlSetColor(-1,0x0000ff) GUICtrlSetBkColor(-1,0x99ccff) $l = GUICtrlCreateLabel("", 20, 55, 310,210) $progress = GUICtrlCreateProgress(0, 0, 350, 30, $PBS_MARQUEE) GuiCtrlSendMsg(-1, $PBM_SETMARQUEE,True,50) GUICtrlCreateLabel(' Office 2010 Tips', -1, 265, 350, 25) GUICtrlSetFont(-1,12,650) GUISetState() $child = GUICreate('', 330, 145, 10, 290, $WS_CHILD, $WS_EX_CLIENTEDGE, $parent) GUISetBkColor(0x123456) GUISetState() $label = GUICtrlCreateLabel($sScrollText1, 0, 20, 330,500, $SS_CENTER) GUICtrlSetFont(-1, 12, 650) GUICtrlSetColor(-1, 0xffff00) GUISetState() Global $iScrollPos = -60 AdlibRegister ( "Adlib", 35 ) Func Adlib() $iScrollPos += 1 ControlMove($child, '', $label, 0, -$iScrollPos) If $iScrollPos > 500 Then $iScrollPos = -60 EndFunc Sleep(15000)
-
I have created a scroll box of information that works fine. Because I had far more information that can fit into a variable, I had to create 15 variables to cover all the information. ie. $sScrollText1 to $sScrollText15 each with a value of lots of text. The scrolling window as it is now will scroll to the bottom of $sScrollText1 and then start over at the top again. What can I use to tell it to go to $sScrollText2 when at the bottom of $sScrollText1 and so on? The text is a total of about 3600 lines 30 characters wide. Thank you.
-
I found this has worked everytime. I used the code at the bottom of the WinKill help to find the class info. Case ProcessExists("EXCEL.EXE") $MSOList1 = _WinAPI_EnumWindows() For $i = 1 To $MSOList1[0][0] If $MSOList1[$i][1] = "XLMAIN" Then $MSOTitle1 = WinGetTitle($MSOList1[$i][0]) WinKill($MSOTitle1) EndIf Next Case ProcessExists("WINWORD.EXE") $MSOList2 = _WinAPI_EnumWindows() For $j = 1 To $MSOList2[0][0] If $MSOList2[$j][1] = "OpusApp" Then $MSOTitle2 = WinGetTitle($MSOList2[$j][0]) WinKill($MSOTitle2) EndIf Next Case ProcessExists("OUTLOOK.EXE") $MSOList3 = _WinAPI_EnumWindows() For $k = 1 To $MSOList3[0][0] If $MSOList3[$k][1] = "rctrl_renwnd32" Then $MSOTitle3 = WinGetTitle($MSOList3[$k][0]) WinKill($MSOTitle3) EndIf Next
-
I am using FileInstall. I did remove some files to get it below 4GB and it did finally work. It went through a lot of different errors but it did finish. I found I had to remove wrapper data at the top of the au3 file also. thanks.
-
I have small AutoIT script but 4GB of files to attach. I zipped the files into a self executing exe so I have only about 5 files to actually compile. I continually get the error below when trying to compile (takes about 5 minutes to get). I have installed AutoIT on a 64bit Win7 with 8GB of RAM and get the same thing. No matter if I get select to continue compiling or stop. The resulting file, although it looks to be the right size (about 4.25GB), will not run saying it is not a win32 exe. Any advice? Thanks. Error: EndUpdateResource: Returncode = 0 - LastError:87:The operation completed successfully.
-
Great thank you everyone. What a fast forum!
-
Ok, so using the command FileInstall also adds the files to the build. I thought you had to 1. add the files to the build, then 2. have a command saying where to extract them to use. This one command does both?
-
No, here it is. Files were added on the Res Add Files tab (see attached). Is this wrong? #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=C:\Users\xx\Desktop\AutoITTest\AdobeReader9.4MUIUpdate\AdobeReaderMUI940_x86.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Comment= #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Res_File_Add=1028.mst #AutoIt3Wrapper_Res_File_Add=1030.mst #AutoIt3Wrapper_Res_File_Add=1031.mst #AutoIt3Wrapper_Res_File_Add=1033.mst #AutoIt3Wrapper_Res_File_Add=1034.mst #AutoIt3Wrapper_Res_File_Add=1035.mst #AutoIt3Wrapper_Res_File_Add=1036.mst #AutoIt3Wrapper_Res_File_Add=1040.mst #AutoIt3Wrapper_Res_File_Add=1041.mst #AutoIt3Wrapper_Res_File_Add=1042.mst #AutoIt3Wrapper_Res_File_Add=1043.mst #AutoIt3Wrapper_Res_File_Add=1044.mst #AutoIt3Wrapper_Res_File_Add=1046.mst #AutoIt3Wrapper_Res_File_Add=1053.mst #AutoIt3Wrapper_Res_File_Add=2052.mst #AutoIt3Wrapper_Res_File_Add=abcpy.ini #AutoIt3Wrapper_Res_File_Add=AcroRead.msi #AutoIt3Wrapper_Res_File_Add=AcroRead.sms #AutoIt3Wrapper_Res_File_Add=AdbeRdr940.bat #AutoIt3Wrapper_Res_File_Add=AdbeRdrUpd940_mui.mst #AutoIt3Wrapper_Res_File_Add=AdbeRdrUpd940_mui_cum.msp #AutoIt3Wrapper_Res_File_Add=Data1.cab #AutoIt3Wrapper_Res_File_Add=Setup.exe #AutoIt3Wrapper_Res_File_Add=setup.ini #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("TrayIconHide", 1) DirCreate("C:\Windows\Temp\AdbeRdrupd940_mui") FileInstall(".\1028.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1028.mst", 1) FileInstall(".\1030.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1030.mst", 1) FileInstall(".\1031.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1031.mst", 1) FileInstall(".\1033.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1033.mst", 1) FileInstall(".\1034.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1034.mst", 1) FileInstall(".\1035.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1035.mst", 1) FileInstall(".\1036.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1036.mst", 1) FileInstall(".\1040.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1040.mst", 1) FileInstall(".\1041.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1041.mst", 1) FileInstall(".\1042.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1042.mst", 1) FileInstall(".\1043.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1043.mst", 1) FileInstall(".\1044.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1044.mst", 1) FileInstall(".\1046.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1046.mst", 1) FileInstall(".\1053.mst", "c:\windows\temp\AdbeRdrUpd940_mui\1053.mst", 1) FileInstall(".\2052.mst", "c:\windows\temp\AdbeRdrUpd940_mui\2052.mst", 1) FileInstall(".\abcpy.ini", "c:\windows\temp\AdbeRdrUpd940_mui\abcpy.ini", 1) FileInstall(".\AcroRead.msi", "c:\windows\temp\AdbeRdrUpd940_mui\AcroRead.msi", 1) FileInstall(".\AcroRead.sms", "c:\windows\temp\AdbeRdrUpd940_mui\AcroRead.sms", 1) FileInstall(".\AdbeRdrUpd940_mui.mst", "c:\windows\temp\AdbeRdrUpd940_mui\AdbeRdrUpd940_mui.mst", 1) FileInstall(".\AdbeRdrUpd940_mui_cum.msp", "c:\windows\temp\AdbeRdrUpd940_mui\AdbeRdrUpd940_mui_cum.msp", 1) FileInstall(".\Data1.cab", "c:\windows\temp\AdbeRdrUpd940_mui\Data1.cab", 1) FileInstall(".\Setup.exe", "c:\windows\temp\AdbeRdrUpd940_mui\Setup.exe", 1) FileInstall(".\Setup.ini", "c:\windows\temp\AdbeRdrUpd940_mui\Setup.ini", 1) FileInstall(".\AdbeRdr940.bat", "c:\windows\temp\AdbeRdrUpd940_mui\AdbeRdr940.bat", 1) RunWait(@ComSpec & " /c " & "c:\windows\temp\AdbeRdrUpd940_mui\AdbeRdr940.bat", "", @SW_HIDE)
-
I created a simple script to drop some files in the windows temp then run a batch file. I used highest compression. The total size of all the files plus the au3 file is 286MB. The final EXE file is 559MB Consists of: DirCreate 24-FileInstall RunWait Wrapper settings, Compile with Options: compression highest, x86, exe, use UPX, requireAdminstrator, extra files-24 added, Run AUECheck, Run Tidy That's it. Why is the final file so huge?