Sign in to follow this  
Followers 0
bmark314

32bit app for both 32bit and 64bit systems

4 posts in this topic

I have found some great advice and tips digging through these forums. Really helpful when you aren't a programmer.

Here is my issue. We have a piece of software that applies updates to systems. It verifies if the updates are intended for the system, then verifies the updates have been applied...either through file version or registry entries. This program was written by someone else at my company and it has now become my responsibilty. Yea. :oops:

I have gotten around the regread/regwrite issue on 64bit systems by specifying hklm64, khcu64, etc when needed.

I have (kind of) gotten around the system32 vs syswow64 on 64bit systems by adding something similar to this:

If @OSArch = "X64" Then DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 0) ; do somthing here if os is 64 bit DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 1) Else ; do somthing here if os is 32 bit EndIf

Both of those solutions were found on these forums...many thanks to whomever posted them!

My question is...is it possible to build a function that checks whether the OSArch is x64, if it is, then it will disable the Wow64FsRedirection, AND automatically converts hklm (or HKEY_LOCAL_MACHINE)to hklm64? (this would also apply to HKCU, HKU, and HKCR)

Any assistance is greatly appreciated. These forums have been a great help!

The program is a 32bit program, and the powers that be don't want to have a seperate 64bit version. They also want to procedures to be the same whether it is run on x86 or x64 systems, hence the question on the registry.

Mark

Share this post


Link to post
Share on other sites



It looks like you are half way there with the example you provided. Just put it into a function that is called at the begging of the script. You could have a global var that could store which HKLM is appropriate using the same func.

Share this post


Link to post
Share on other sites

here is a bit of a tip that I won't explain.

just use hk**64 regardless of whether or not it's 64 bit. that will be handled properly on 32 bit.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

here is a bit of a tip that I won't explain.

just use hk**64 regardless of whether or not it's 64 bit. that will be handled properly on 32 bit.

Hmm, good to know.

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