rbhkamal Posted October 6, 2010 Posted October 6, 2010 When compiling autoit scripts into exe, is there a way to make the output path dependent on the target CPU architecture? Something like this? .\out\win.$(arch)\theFile.exe Thanks "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
trung0407 Posted October 6, 2010 Posted October 6, 2010 I don't know a direct way to make it, but I know a way to do it using a autoit script. I'll tell if you interest
rbhkamal Posted October 6, 2010 Author Posted October 6, 2010 (edited) I don't know a direct way to make it, but I know a way to do it using a autoit script. I'll tell if you interest I have a level of interest in almost anything, the real question is how much interest do I have in your script. The next logical question is , how do you quantify interest? The answer is almost certainly dependent on relativity which brings me to ask the question, what are the two things that the difference between them is exactly one? Lets theorize that there are such two things and lets call the difference kukuBase on the above, I believe my interset in your script is almost exactly 42 kuku which is also the answer to life the universe and everything Edited October 6, 2010 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
trung0407 Posted October 6, 2010 Posted October 6, 2010 (edited) Ok, I don't know what you are talking about 42 and kuku, but here is the thing. In an autoit script, you can check the architecture of your machine @CPUArch You can also compile a script using command line. So the algorithm is basically like this. if @CPUArch is x86 then execute Aut2exe.exe /in [source] /out path/[insert architecture here] /[architecture] else ... same for x64 Edited October 6, 2010 by trung0407
rbhkamal Posted October 6, 2010 Author Posted October 6, 2010 Ok, I don't know what you are talking about 42 and kuku, but here is the thing.You do not know what 42 is?! OMG google the following:what is the answer to life the universe and everything? "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
trung0407 Posted October 6, 2010 Posted October 6, 2010 now i know, but did I answer to your problem?
rbhkamal Posted October 7, 2010 Author Posted October 7, 2010 now i know, but did I answer to your problem?Yes and no, I was looking for something simple... just like visual studio configuration variables but your suggestion solves the problem.The reason why I want this is because everytime I want to do a 64bit build or a 32bit build, I must change the output path manually. Now, other people have to do the build and they are not doing it correctly... which resulted in the 64bit versions getting shipped off to testing... and waisting money. "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
trung0407 Posted October 7, 2010 Posted October 7, 2010 2nd method ;64 #AutoIt3Wrapper_UseX64=1 ;x86 #AutoIt3Wrapper_UseX64=0 I didn't add all but might have a look at the autoit3wrapper
BrewManNH Posted October 7, 2010 Posted October 7, 2010 Here's something I threw together just now that might help get you started in the right direction. #include <guiconstants.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("Compile", 250, 200, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") Global $x86Button = GUICtrlCreateButton(" X86 ", 20, 150) GUICtrlSetOnEvent(-1, "X86") Global $x64Button = GUICtrlCreateButton(" X64 ", 100, 150) GUICtrlSetOnEvent(-1, "X64") Global $Input = GUICtrlCreateInput("", 20, 20, 170) Global $Browse = GUICtrlCreateButton(" ... ", 200, 20, Default, 20) GUICtrlSetOnEvent(-1, "browse") GUISetState() While 1 Sleep(100) WEnd Func browse() Global $File = FileOpenDialog("Compile which file", @ScriptDir, "Au3 files (*.au3)") GUICtrlSetData($Input, $File) EndFunc ;==>browse Func Form1Close() Exit EndFunc ;==>Form1Close Func x64() RunWait("G:\Autoit3\Aut2Exe\Aut2Exe.exe /in " & '"' & GUICtrlRead($Input) & '"' & " /x64 /comp 4 /gui") MsgBox(48, "Done", "You have completed the 64 bit compile of the script " & GUICtrlRead($Input)) EndFunc ;==>x64 Func x86() RunWait("G:\Autoit3\Aut2Exe\Aut2Exe.exe /in " & '"' & GUICtrlRead($Input) & '"' & " /comp 4 /gui") MsgBox(48, "Done", "You have completed the 32 bit compile of the script " & GUICtrlRead($Input)) EndFunc ;==>x86 It's not the prettiest GUI in the world, but it works for compiling in either x86 or x64 mode and lets you select which file you want to compile. You might want to add in where you want each to be saved so they don't overwrite each other if you compile the file more than once. At least this should serve as a foundation to a concept you can build upon. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
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