Sign in to follow this  
Followers 0
corz

conditional FileInstall

19 posts in this topic

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

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
BTW, thanks to Jos for including the environment feature in the SciTe4AutoItWrapper. :thumbsup:

 

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.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#15 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

how about just install both the dll then check the bit version, and finally just delete the dll not needed

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0