corz Posted July 6, 2014 Share Posted July 6, 2014 I build 32bit and 64 bit versions of an app with a DLL installed with FIleInstall(). Obviously I have two versions of the DLL, installed conditionally (checking against @AutoItX64 macro). This all works fine. The problem is that I also have two DLLs, one 32 bit and one 64 bit, inside both of the .exe files! Is there some way to avoid this (aside from keeping two versions of the source)? I'm thinking something like #section_x64. I couldn't find anything in the documentation. ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
iCode Posted July 6, 2014 Share Posted July 6, 2014 if your concern is one of space on the users drive, and if you are open to using an installer, Inno Setup can handle that for you and you can get rid of the FileInstall function there may be other ways, but that is all that comes to mind at the moment FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2014 Share Posted July 6, 2014 It could be downloaded. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
corz Posted July 6, 2014 Author Share Posted July 6, 2014 Thanks, but I have my own installer. I need the DLL inside the .exe, that part isn't negotiable! ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2014 Share Posted July 6, 2014 Then you either have both dlls embedded or you have two sources. Simple. Perhaps you can you explain why you would need a 64 bit dll for use with a 32 bit process. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
corz Posted July 6, 2014 Author Share Posted July 6, 2014 I don't. Like I said, I build both 32 and 64 bit versions. So I need both 32 and 64 bit DLLs. ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2014 Share Posted July 6, 2014 Ok so why do you need both dlls in one exe? I also have two DLLs, one 32 bit and one 64 bit, inside both of the .exe files! AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 6, 2014 Developers Share Posted July 6, 2014 (edited) Ok so why do you need both dlls in one exe? All the OP wants is one Script source that can be compiled for both x86 and x64 and each output EXE will include the appropriated version of the DLL. Edited July 6, 2014 by Jos JohnOne 1 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 More sharing options...
Exit Posted July 6, 2014 Share Posted July 6, 2014 It's real a shame, that Fileinstall() does not accept environment variables. This variables are pesent at compile time and there is no showstopper to use them. Or is there a technical drawback? BTW, thanks to Jos for including the environment feature in the SciTe4AutoItWrapper. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Developers Jos Posted July 6, 2014 Developers Share Posted July 6, 2014 (edited) Is this something that would work for you? : Demo script #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Before=copy "included.%usex64%.dll" "included.dll" Fileinstall("Included.dll","destination path") This will copy "included.n.dll" to "included.dll" before compile. When #AutoIt3Wrapper_UseX64=y then "included.y.dll" is copied. This allows for 2 different versions to be included depending on the output architecture. You need the current Beta version of AutoIt3Wrapper for support for %usex64%. Jos Edited July 6, 2014 by 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 More sharing options...
Developers Jos Posted July 6, 2014 Developers Share Posted July 6, 2014 BTW, thanks to Jos for including the environment feature in the SciTe4AutoItWrapper. Well, I had to rip a part of it out again as there is a conflict/regression when using the GUI (Ctrl+F7), so it is still the case but for a limited number of fields. 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 More sharing options...
3jameo3 Posted July 6, 2014 Share Posted July 6, 2014 in my experience with installing programs on a 64bit and a 32bit computer is that 90% of all 32bit programs will run on a 64bit computer (not saying this is the case every time), maybe a conditional statement where the program itself checks the bit version of the computer and then only installs the correct DLL file to the computer would work? Simply renaming the DLL's to say blahx64,dll or blahx32.dll may work in this case. Another idea is having radio buttons asking the user themselves if their computer is 64bit or 32bit then making the program go off of that answer to install the correct dll file. Of course the DLL's would have to be named somewhat different in the beginning then maybe a stringreplace or something to rename the dll file so you don't have to completely rework your program would work. These are just some ideas I've picked up from other threads I've read on here they may or may not work how you want it, of course I'm just a beginner in this type coding but hopefully I've helped a bit. Link to comment Share on other sites More sharing options...
JohnOne Posted July 6, 2014 Share Posted July 6, 2014 Thing with that is both dlls will still be embedded. If fileinstall accepted a variable as source, it would not be a problem, but like jos says preprocessor is the only way really. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
corz Posted July 6, 2014 Author Share Posted July 6, 2014 Is this something that would work for you? : Demo script #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Before=copy "included.%usex64%.dll" "included.dll" Fileinstall("Included.dll","destination path") This will copy "included.n.dll" to "included.dll" before compile. When #AutoIt3Wrapper_UseX64=y then "included.y.dll" is copied. This allows for 2 different versions to be included depending on the output architecture. You need the current Beta version of AutoIt3Wrapper for support for %usex64%. Jos This looks fun, thank you (I didn't know about %usex64%), but I ideally I'd like to keep.. #AutoIt3Wrapper_Compile_Both = Y And have it happen automatically. The final DLLs have different names (some.dll and some_x64.dll), as both may be installed (next to each other, in ProgramData dir) on a particular system (where both 32 bit and 64 bit versions are installed, as does happen). A variable would be ideal, but I understand that isn't possible. An x64-only #section would be perfect! ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 6, 2014 Developers Share Posted July 6, 2014 (edited) The #AutoIt3Wrapper_Compile_Both = Y won't work as the #AutoIt3Wrapper_Run_Before are only run one time before the actual compile process. The only other option I can think of is to write your own script that will run autoit3wrapper 2 times with the right parameters b=and you copy the DLL before. Jos Edited July 6, 2014 by 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 More sharing options...
jguinch Posted July 6, 2014 Share Posted July 6, 2014 Is there a way with #AutoIt3Wrapper_Run_After and an update of the DLL file into one of the two compiled files ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
corz Posted July 7, 2014 Author Share Posted July 7, 2014 The #AutoIt3Wrapper_Compile_Both = Y won't work as the #AutoIt3Wrapper_Run_Before are only run one time before the actual compile process. The only other option I can think of is to write your own script that will run autoit3wrapper 2 times with the right parameters b=and you copy the DLL before. Jos Thanks. I had considered this first, but I like too much just hitting a single HotKey and getting two exe files to play with. I guess I'll just wait until the developers add something (or not)! My DLLs aren't that big, so at least for now, it's not a major worry. Is there a way with #AutoIt3Wrapper_Run_After and an update of the DLL file into one of the two compiled files ? Not that I know of. Besides, that sounds like a recipe for breaking the executable. ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
pcjunki Posted July 7, 2014 Share Posted July 7, 2014 how about just install both the dll then check the bit version, and finally just delete the dll not needed Link to comment Share on other sites More sharing options...
corz Posted July 7, 2014 Author Share Posted July 7, 2014 The DLL installation isn't the problem, each version automatically installs its own DLL, as required, at run-time. And having both installed on the system is fine too, even desirable; if the user has both 32 and 64 bit versions of the app installed. The only problem is that the 32 bit app contains a 64 bit DLL, and visa-versa. But like I say, it's not a major worry, I just wondered if it could be done easily, because it seems like something that should be easy to do. ;o) Cor nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
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