Sign in to follow this  
Followers 0
Guest BinaryVision

Right-click compile, files are double the size...bug?

2 posts in this topic

#1 ·  Posted (edited)

Hello. I have recently updated my installation of AutoIt from beta to release 3.2.0.1. If I use the compile command with a script open within the latest version of SciTE, one script complied to a 199KB EXE file. If I compile the same script via the right-click command within Windows Explorer, the resulting EXE is 394KB!!! I have never observed this before with the older versions. Is this a "feature" or a bug?

Compiled with AutoIt 3.2.0.1 operating on Windows XP Professional SP2. Any ideas? Thanks! Also, I've noticed the behavior is different in the latest SciTE. Using the compile option brings up the Aut2Exe dialog rather than automatically compiling the EXE into the script's directory. How can I change this?

Example script for compile:

;===========================================================================================
;  Script Purpose:      Install SAS 9.1.3 w/SP4 for Windows
;  Script Author:       Andrew XXXXXXXXXX
;  AutoIt Version:      3.2.0.1
;  Revision Date:       07-SEP-2006
;  Last Revised By:     
;  Comments:            This script will run the SAS Setup and System Requirements Wizard
;                       (if necessary). Then the "-nofmterr" line is added to the SAS config 
;                       file and appropiate permissions are applied to specific folders 
;                       under C:\.  The SAS Installation Qualification Tool is run with its 
;                       output saved in C:\DEPLOY\SAS.  Due to possible required reboots, 
;                       the entire script may not work properly on certain systems.
;===========================================================================================

;declarations
#include <date.au3>
#include <file.au3>
Opt("WinTitleMatchMode",4)

;create directories for later use
DirCreate('C:\DEPLOY')
DirCreate('C:\TEMP')

;run main SAS setup program
$pid = Run(@ScriptDir & '\disk1\sas\setup.exe')
WinWaitActive('Choose Setup Language', 'English')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Welcome to the SAS Setup')
ControlClick('last', '', 1)

;if system does not meet minumum requirements, complete the wizard
If WinWait('InstallShield Wizard', 'System Requirements Check',8) Then
    ControlClick('last', '', 1)
    ProcessWaitClose($pid)
    $pid = Run(@ScriptDir & '\disk1\srw\setup.exe')
    WinWaitActive('Choose Setup Language', 'English')
    ControlClick('last', '', 1)
    WinWaitActive('InstallShield Wizard', 'Welcome to the System Requirements')
    ControlClick('last', '', 1)
    WinWaitActive('InstallShield Wizard', 'Specify a JRE')
    ControlClick('last', '', 1)
    While WinExists('', 'Installing Java Runtime Environment 1.4.2_09')
        Sleep(2000)
    WEnd
    If WinExists('InstallShield Wizard', 'Automatic Log On') Then
        ControlClick('last', '', 1)
        WinWaitActive('InstallShield Wizard', 'System Components Update')
        ControlClick('last', '', 1)
    EndIf
    WinWaitActive('InstallShield Wizard', 'System Update Finished')
    ControlClick('last', '', 1)
    ProcessWaitClose($pid)
;restart main SAS setup after wizard is finished
    $pid = Run(@ScriptDir & '\disk1\sas\setup.exe')
    WinWaitActive('Choose Setup Language', 'English')
    ControlClick('last', '', 1)
    WinWaitActive('InstallShield Wizard', 'Welcome to the SAS Setup')
    ControlClick('last', '', 1)
EndIf

;continue with main SAS setup program
WinWaitActive('InstallShield Wizard', 'Retrieve SAS Installation')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Your SAS Installation Data')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Destination Folder')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Data Files Folder')
ControlSetText('last', '', 4, 'C:\SAS Files\9.1')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Temporary Files Folder')
ControlSetText('last', '', 4, 'C:\SAS Temporary Files')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Select Components')
Sleep(1000)
Send('{SPACE}') ;deselect licensed components of SAS Software
Sleep(1000)
Send('{SPACE}') ;select all components
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Start Copying Files')
ControlClick('last', '', 1)
WinWaitActive('Confirm Update', 'Change to the value')
ControlCommand('last', '', 1087, 'Check', '')
ControlClick('last', '', 1)
WinWaitActive('InstallShield Wizard', 'Setup has successfully')
ControlClick('last', '', 1)
ProcessWaitClose($pid)

;write entry to system install log
$logfile = 'C:\DEPLOY\install_log.txt'
If Not FileExists($logfile) Then _FileCreate($logfile)
_FileWriteLog($logfile, 'SAS 9.1.3 Service Pack 4 installed')

;write entry to SAS configuration file
FileWriteLine('C:\Program Files\SAS\SAS 9.1\nls\en\SASV9.CFG', '-nofmterr')

;apply permissions to folders under C:\ for non-administrators
RunWait(@ComSpec & ' /c cacls "C:\SAS Files" /e /t /g "Users":c | ' & _
    'cacls "C:\SAS Files" /e /t /g "Power Users":c | ' & _
    'cacls "C:\SAS Temporary Files" /e /t /g "Users":c | ' & _
    'cacls "C:\SAS Temporary Files" /e /t /g "Power Users":c | ' & _
    'cacls "C:\TEMP" /e /t /g "Users":c | ' & _
    'cacls "C:\TEMP" /e /t /g "Power Users":c')

;run the SAS IQ Tool and save output
$pid = Run('C:\Program Files\SAS\SAS 9.1\sastest\sasiq.exe')
WinWaitActive('C:\Program Files\SAS\SAS 9.1\sastest\sasiq.exe')
Send('C:\DEPLOY\SAS{ENTER}')
ProcessWaitClose($pid)

;copy SAS shortcut to the desktop
FileCopy(@ProgramsCommonDir & '\SAS\SAS 9.1 (English).lnk', @DesktopCommonDir & '\SAS 9.1.lnk')

;display a confirmation message
$fmtdate = StringReplace(_NowCalcDate(), '/', '')
MsgBox(64, 'Install Script', 'SAS 9.1.3 Service Pack 4 was installed successfully.' & _
    @CR & @CR & 'Validation output can be found in the following folder:' & @CR & _
    'C:\DEPLOY\SAS\ivt_' & $fmtdate & '.000')
Edited by BinaryVision

Share this post


Link to post
Share on other sites



UPX compression is now optional. Use the Aut2Exe Gui to change settings.

:P

Share this post


Link to post
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
Sign in to follow this  
Followers 0