FOLLOW US
softpcapps Software CODE HELP BLOG

Shareware and free Open Source Windows Software Applications and free Online Tools

How to include different versions of a file for 32-bit and for 64-bit computers

Sometimes you need to write to the user's computer different versions of a file.
For example you want to write a different shell extension dll file for 32-bit computers and a different one for 64-bit computers.

Then you have to do something like the following :


${If} ${RunningX64}
   File /oname=MY_FILE.dll "YOUR_FILE_FOR_64BIT.dll" 
${Else}
; 32bit things here
   File /oname=MY_FILE.dll "YOUR_FILE_FOR_32BIT.dll" 
${EndIf}  

MY_FILE.dll is the filename of the output file in the user's directory. YOUR_FILE_FOR_64BIT.dll is the file that is will be written for 64-bit and YOUR_FILE_FOR_32BIT.dll is the version file that will be written for 32-bit computers.

Also, you have to put in your header :


  !include "x64.nsh"