Archive: Newb SetRegView question


Newb SetRegView question
Hello, I'm writing an application in C# with the platform target AnyCPU. On x86 machines the app runs as 32-bit and on x64 it runs as 64-bit. This way I only need a single installer instead of a separate one for x64.

My install script uses x64.nsh and changes the InstallDir in the .onInit function:

${If} ${RunningX64}
StrCpy $instdir "$PROGRAMFILES64\MyApplication"
${EndIf}

My question is, is there any other changes I need to make to the script for x64 machines? I've read about the SetRegView function but I don't know when and where to use it.


If you create any registry entries in the installer that your program depends on to read/set then on 64-bit you should use 'SetRegView 64'. Like so..

SetRegView 64
WriteRegStr $INSTDIR HKLM Software\NSIS ""
SetRegView 32

Otherwise if they are just keys the installer/uninstaller uses (like uninstall information for add/remove programs or figuring out where the program was installed) then it doesn't really matter since your program won't care about them. SetRegView won't affect a 32-bit system so it shouldn't be necessary to use ${if} ${runningx64}.


Thanks for the quick response! My app doesn't depend on any registry keys so I think I'll leave SetRegView alone for now. Thanks again :)