Jump to content

Include Other EXE into Autoit Compiler Without FileInstall


Sudiro
 Share

Recommended Posts

 

I apologize i new but already asking questions .. how to add another program exe file into autoit compiler without using fileinstall, load the file in the exe itself. I've been searching in this forum and try one by one in help file, found about resources.au3 but I don't quite understand.

this is my script :

 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin

MBRWiz()

Func MBRWiz()
    FileInstall ("MBRWiz.exe", @TempDir &"\")
    GUICreate(" Test MBRWiz", 200, 100)
    Local $part = GUICtrlCreateInput('', 20, 20, 160, 20)
    Local $idBtn = GUICtrlCreateButton("Hide Partition", 20, 60, 160, 20)

    GUISetState(@SW_SHOW)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                FileDelete (@TempDir &"\MBRWiz.exe")
                ExitLoop
            Case $idBtn
                $RPart = GUICtrlRead($part)
                $iMsgBoxAnswer = MsgBox(1,"Question","Are You Sure To Hide No"& $RPart &" Partition")
                Select
                    Case $iMsgBoxAnswer = 1
                        RunWait (@TempDir &"\MBRWiz.exe /hide /part="&$RPart&"")
                    Case $iMsgBoxAnswer = 0
                EndSelect
        EndSwitch
    WEnd
EndFunc
 

I want to Acces mbrwiz.exe without extract to TempDir, direct access in autoit exe compiler .. Without FileInstall..

Link to comment
Share on other sites

Just now, Sudiro said:

 

I apologize i new but already asking questions .. how to add another program exe file into autoit compiler without using fileinstall, load the file in the exe itself. I've been searching in this forum and try one by one in help file, found about resources.au3 but I don't quite understand.

this is my script :

 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin

MBRWiz()

Func MBRWiz()
    FileInstall ("MBRWiz.exe", @TempDir &"\")
    GUICreate(" Test MBRWiz", 200, 100)
    Local $part = GUICtrlCreateInput('', 20, 20, 160, 20)
    Local $idBtn = GUICtrlCreateButton("Hide Partition", 20, 60, 160, 20)

    GUISetState(@SW_SHOW)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                FileDelete (@TempDir &"\MBRWiz.exe")
                ExitLoop
            Case $idBtn
                $RPart = GUICtrlRead($part)
                $iMsgBoxAnswer = MsgBox(1,"Question","Are You Sure To Hide No"& $RPart &" Partition")
                Select
                    Case $iMsgBoxAnswer = 1
                        RunWait (@TempDir &"\MBRWiz.exe /hide /part="&$RPart&"")
                    Case $iMsgBoxAnswer = 0
                EndSelect
        EndSwitch
    WEnd
EndFunc
 

I want to Acces mbrwiz.exe without extract to TempDir, direct access in autoit exe compiler .. Without FileInstall..

 

Link to comment
Share on other sites

@Sudiro,

welcome to AutoIt and to the forum.

be aware that except FileInstall(), all other methods to include a file in your script - be it an executable, a graphic image, a DLL, custom font, sound, etc. - are far more complex. if there is a real need to avoid FileInstall(), then you need to put the effort into learning the technique, try the examples, and adapt to your needs. no-one can do that for you.

considering you are somewhat a beginner to AutoIt - no offense - i advise you reconsider your requirement to avoid FileInstall().

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

5 minutes ago, orbs said:

@Sudiro,

welcome to AutoIt and to the forum.

be aware that except FileInstall(), all other methods to include a file in your script - be it an executable, a graphic image, a DLL, custom font, sound, etc. - are far more complex. if there is a real need to avoid FileInstall(), then you need to put the effort into learning the technique, try the examples, and adapt to your needs. no-one can do that for you.

considering you are somewhat a beginner to AutoIt - no offense - i advise you reconsider your requirement to avoid FileInstall().

 

thanks orbs .. on your advice. 
I'll try to read and learn the examples in this forum ..

if it's possible to run user application without fileinstal ..

Link to comment
Share on other sites

On 13/10/2016 at 10:35 PM, AdamUL said:

You can give the Inline Binary Files by willichan a try.  I have used it successfully.  

 

Adam

Hot To add Binary mbrwiz to my script.?.

 

this mbrwiz.exe if drop to inlineme.exe

#include-once
#include <file.au3>

Func _MBRWizexe_Startup()
    Local $Inline_Filename = _TempFile(@TempDir, "~", ".EXE")
    Local $InlineOutFile = FileOpen($Inline_Filename, 2)
    If $InlineOutFile = -1 Then Return SetError(1, 0, "")

    FileWrite($InlineOutFile, _MBRWizexe_Inline())
    FileClose($InlineOutFile)
    Return $Inline_Filename
EndFunc   ;==>_MBRWizexe_Startup

Func _MBRWizexe_Shutdown($Inline_Filename)
    FileDelete($Inline_Filename)
EndFunc   ;==>_MBRWizexe_Shutdown

Func _MBRWizexe_Inline()

Local $sData
    #region    ;MBRWiz.exe
    $sData  = "0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000E80000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A24000000000000004C6CF527080D9B74080D9B74080D9B749FC9E5740C0D9B742FCBE6741D0D9B742FCBF674810D9B74CB02C6740F0D9B74080D9A747E0D9B742FCBF5743F0D9B742FCBE774090D9B742FCBE374090D9B7452696368080D9B7400000000000000000000000000000000504500004C01040094E653440000000000000000E00003"
..................................................

    $sData &= "44"
    #endregion ;MBRWiz.exe
    Return Binary($sData)
EndFunc   ;==>_MBRWizexe_Inline
    

Link to comment
Share on other sites

On 21/10/2016 at 10:13 PM, AdamUL said:

Your welcome. 

 

Adam

 

Dear Adam...

Sorry ...

If dragdrop exe file 289 kb, when execute file in autoit.. Display Commad prmpt "Program to big to fit in memory"

Work fine in 141 kb exe file, Execute file not problem..

Change $blocksize = 512 to 1025 or 2049 in InlineMe.au3  still "Program to big to fit in memory"

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