Jump to content

Create message if executable is successful/failure


Recommended Posts

I am running a program that contains the following code. Once the "Install" executable is done I'd like to create a document (preferably txt) that writes a message whether this Install exe was successful or not. Is this possible? If so, how?

RunWait( "C:\Users\user\Desktop\Install.exe")

 

Link to comment
Share on other sites

3 minutes ago, greichert said:

I am running a program that contains the following code. Once the "Install" executable is done I'd like to create a document (preferably txt) that writes a message whether this Install exe was successful or not. Is this possible? If so, how?

RunWait( "C:\Users\user\Desktop\Install.exe")

 

I guess a better first question is how do I return a message of any kind whether the exe faild or not? I can figure out how to print it to a txt from there 

Link to comment
Share on other sites

  • Moderators

There are a couple of ways to go about this, but it all depends on the install. Is the install executable writing to its own log file, or even the Event Viewer, to determine successful exit code? Does the executable disappear once it is done so you can check for the existence of the process? A little more detail is needed, as not every install is made the same.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I guess you could check for changes in installed applications in registry, so in theory, if there's one more than before, something was installed.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

If you assign that Runwait command to a variable   eg    $var = RunWait("someprogram.exe")    then var will hold whatever exit code that program generates.

If this is an installer for software though you can directly test that the files, registry keys and shortcuts have been created using AutoIT.

Run FileMon and RegMon or something like that, do the install.   Find all the stuff the installer added.   Write autoit code to confirm all those things have been done.

It's amazing how easy it is to SAY those things :)

Link to comment
Share on other sites

3 hours ago, gruntydatsun said:

It's amazing how easy it is to SAY those things :)

I don't get it. 

 

@greichert 

Hi,

can you say us what program are you installing ? 

As Careca said we need more info.  

 

Gruntydatsun suggestions are very good but it will depend of what software you would like to install. 

 

I did that check with multiple way... I used a lot Gruntydatsun suggestion with the registry and it is very well. And can be real time scan. 

 

Also I checked that with some installation GUI checking... for exemple i had a text after installation that was sent by the application : "Done !"

When I was reading that i know it was Installed. 

 

Well it is not the most safe way to do that kind of check but if you are sure about how the installation work.... if it s not buggy. the most simple/fast way is also to check the existence of the folders in programm files or what ever. 

 

Here is a bunch of command you can learn to help you to do that : 

FileExists 
RegRead
RegWrite 
_GUICtrlListBox_GetText

 

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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