Jump to content

Include the script file


ChrisL
 Share

Recommended Posts

I know that you can use the decompiler but if you wanted to include the script file as a safe guard then put this at the top of your script.

Replace "Put the name of the au3 file here.au3" with your file name and add a password in to the password variable.

To recover the script, launch your exe with the command line "recover", so either create a shortcut with the recover parameter or from the command prompt "Myfile.exe recover" you will then be prompted for the password, if they match then the au3 file will be written to your current script directory.

For ease of use you could add it to your template.au3 file in your "C:\Documents and Settings\UserName\Templates" directory

Update: based on dabus' version which is less work, well done!

$password = "MyPassword"
If $CMDLINE [0] > 0 and $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then 
        FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
        MsgBox (0,"Output File",StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ,5)
    Else 
        MsgBox (0,"Error","Incorrect password" ,5)
    EndIf
Exit
EndIf
; Script Start - Add your code below here
Edited by ChrisL
Link to comment
Share on other sites

Why don't you do

$password = "MyPassword"
If $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
Exit
EndIf

?

First steps seem to be quit useless to me.

Link to comment
Share on other sites

First steps seem to be quit useless to me.

No, the first part includes the file in the compiled exe at compile time.

The second part allows you to recover the script from compile time with a password from the exe.

Link to comment
Share on other sites

Why don't you do

?

First steps seem to be quit useless to me.

Yes i have tried yours and it works. The compiler adds all files ignoring conditions. But it only extracts them if the condition surrounding them is true

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Yes appologies dabus you are correct.

$password = "MyPassword"
If $CMDLINE [0] > 0 and $CMDLINE [1] = "recover" Then
    $check = InputBox ("Recover", "Password?","", "*")
    If $Check = $password then 
        FileInstall ("Put the name of the au3 file here.au3", StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ) 
        MsgBox (0,"Output File",StringtrimRight (@ScriptFullPath, 4) & "_rec.au3" ,5)
    Else 
        MsgBox (0,"Error","Incorrect password" ,5)
    EndIf
Exit
EndIf
; Script Start - Add your code below here
Edited by ChrisL
Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

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