Jump to content

Alternative to FileInstall?


Recommended Posts

First, this is not another "Why can't I use variables in FileInstall" question.

This is a "Help me figure out how to do this" question.

Following a suggestion elsewhere on the forums I am using an argument in all my scripts to get back the original .au3 file from a compiled exe in case I lost the original source (which has happened to me twice recently.

That part is working fine, but I have to constantly remember to change a line in my script.

In effect here is what I want to do: FileInstall(@ScriptFullPath, "C:\")

I know I can't do that though.

I'm forced to use: FileInstall("D:\Scripts\SourceFile.au3", "C:\") in all my scripts.

Problem is, "SourceFile.au3" always needs to be the actual name of the current script I'm editing. I'm trying to remember to always change that to the name of the script I'm creating, but I know for a fact I'll forget at some point.

Is there any alternative to automate this in my script?

Link to comment
Share on other sites

You could use these two directives to run a script that changes the macro to a string (and change it back to a macro afterwards if neccesary).

#AutoIt3Wrapper_Run_Before=
#AutoIt3Wrapper_Run_After=

You can read more about these and other directives by checking the page "AutoIt3Wrapper" in the SciTE helpfile (you will probably need to install the FULL SciTE package if you haven't)

Link to comment
Share on other sites

Interesting, I never thought of macroing my editor. (I use Notepad++, not used SciTE)

I'll give it a try.

Still with advanced as AutoIt is, you'd think there'd be a way to write it in the script.

Link to comment
Share on other sites

  • Developers

Macroing the editor? No no, #AutoIt3Wrapper is a separate program that runs when you press compile from SciTE. Can't you use that in Notepad++?

As Obama would say: Yes you can.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

I don't know how to compile in Notepad++. I've just been using Aut2Exe when I'm done editing my script.

Maybe I should start using SciTE instead...

Notepad++ is a nice editor too using the same SciLexer as SciTE, but you will have to set all configuration options yourself where SciTE is already done.

I remember others already did some work on configuring Notepad++ but cannot remember who it was on this forum at this moment.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

It depends on how complex or not you want the process to be in NPP,

I would recommend using the NPPExec console or the Execute (F6) menu option, both you will find in the Plugins-NppExec menu.

alternatively the quickest way is to use the Run menu Option (F5).

Example:

1) Press F5 to bring up the Run Dialog.

2) Type the correct path to AutoItWrapper or Aut2Exe into the combo field like so::

c:\wuh\Aut2Exe.exe /in $(FULL_CURRENT_PATH)

3) Click the save button in the dialog, this should bring up another window in which you name your menu item + set the shortcut keys for it.

4) Click ok, now the item should be added to the Run Menu for easy invocation.

If you want to find out a complete list of the types of macros $(...) that Npp supports, either type help into the NppExec console, or read the man pages.

Vlad

Edited by Mobius

wtfpl-badge-1.png

Link to comment
Share on other sites

#AutoIt3Wrapper_Res_SaveSource=y ;(Y/N) Save a copy of the Scriptsource in the EXE resources. default=N

If you used that param in AutoItWrapper, how would you later go about getting the source back out of the exe?

Link to comment
Share on other sites

If you used that param in AutoItWrapper, how would you later go about getting the source back out of the exe?

Use Reshacker.exe or resource Windows API functions for extraction.

You may look at my Resource UDF as example of using resource API functions.

Link is in my signature.

Edited by Zedna
Link to comment
Share on other sites

I see. I got that to work, thanks! I can now see the source in ResHack.

However, is there some param I can add to the wrapper so that I don't have to run "UPX -d" before I can see the source files?

I see if I so RES_FILE_ADD it says it'll do that, but what if I am not wanting to add another file to the exe?

Link to comment
Share on other sites

I see.  I got that to work, thanks!  I can now see the source in ResHack.

However, is there some param I can add to the wrapper so that I don't have to run "UPX -d" before I can see the source files?

I see if I so RES_FILE_ADD it says it'll do that, but what if I am not wanting to add another file to the exe?

To see all wrapper options press Ctrl+F1 in Scite

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_Res_SaveSource=y 
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"
Edited by Zedna
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...