Dr.Chi Posted July 15, 2009 Posted July 15, 2009 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?
AdmiralAlkex Posted July 15, 2009 Posted July 15, 2009 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) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Dr.Chi Posted July 15, 2009 Author Posted July 15, 2009 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.
AdmiralAlkex Posted July 15, 2009 Posted July 15, 2009 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++? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Developers Jos Posted July 15, 2009 Developers Posted July 15, 2009 On 7/15/2009 at 3:26 PM, 'AdmiralAlkex said: 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.
Dr.Chi Posted July 15, 2009 Author Posted July 15, 2009 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...
Developers Jos Posted July 15, 2009 Developers Posted July 15, 2009 On 7/15/2009 at 6:22 PM, 'Dr.Chi said: 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.
Mobius Posted July 15, 2009 Posted July 15, 2009 (edited) 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 July 15, 2009 by Mobius
Dr.Chi Posted July 15, 2009 Author Posted July 15, 2009 Thanks Mobius, I now have Au32Exe running in npp. I've never used AutoitWrapper, I'm going to look for it and read up on it.
Zedna Posted July 15, 2009 Posted July 15, 2009 (edited) In Scite/Wrapper there is option for that:#AutoIt3Wrapper_Res_SaveSource=y ;(Y/N) Save a copy of the Scriptsource in the EXE resources. default=N Edited July 15, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Dr.Chi Posted July 16, 2009 Author Posted July 16, 2009 On 7/15/2009 at 8:05 PM, 'Zedna said: #AutoIt3Wrapper_Res_SaveSource=y ;(Y/N) Save a copy of the Scriptsource in the EXE resources. default=NIf you used that param in AutoItWrapper, how would you later go about getting the source back out of the exe?
Zedna Posted July 16, 2009 Posted July 16, 2009 (edited) On 7/16/2009 at 12:36 PM, 'Dr.Chi said: 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 July 16, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Dr.Chi Posted July 16, 2009 Author Posted July 16, 2009 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?
Zedna Posted July 16, 2009 Posted July 16, 2009 (edited) On 7/16/2009 at 1:05 PM, 'Dr.Chi said: 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 July 16, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Dr.Chi Posted July 16, 2009 Author Posted July 16, 2009 I was forgetting the "#AutoIt3Wrapper_useupx=n" line. This works great, thanks!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now