32-bit vs. 64-bit Installation

Got a problem you cannot solve? Try here.
depalau
Posts: 5
Joined: Thu Mar 29, 2012 9:51 am

32-bit vs. 64-bit Installation

Postby depalau » Thu Apr 10, 2014 1:56 pm

I have a very simple installation that just needs to install one Microsoft file (MSCOMCT2.OCX) into either the Windows System32 or SysWOW64 folder based on whether or not we are running 32-bit or 64-bit Windows. And then use the appropriate RegSvr32 command to register the file.

I'm a little confused as the recommended way to do this - seems like there are similar questions in the forums but I'm not quite sure if the offered solutions are recommended solutions or not (a lot of different ways to do it and some of the questions are a little bit older using different versions of InstallAware). We are using InstallAware 18 (Build 1.29.14).

We have created a Native Setup and then added some code to check if we are running 64-bit windows and set a custom variable to either the System32 or SysWOW64 folder (after these two system variables are set). Then we do the Install Files command pointing to this custom variable as the target folder. We have the 'File is Self Registering DLL' option set.

I guess my questions are:

1. Is this additional code necessary? Is there something we can just configure in the Design section of the InstallAware IDE without having to do this?

2. Will the 'File is Self Registering DLL' be smart enough to use the correct RegSvr32 (from System32 or SysWOW64) based on where the file was actually installed?


Thanks in advance for any responses and for saving me from having to experiment.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: 32-bit vs. 64-bit Installation

Postby FrancescoT » Fri Apr 11, 2014 11:08 am

Dear User,

The code required is really minimal and currently it is not possible to the same vie IDE.

Anyway to summarize the code required to release an hybrid 32/64 installer;

Place the following code in the at the very beginning of [Define Global] region of the main script;

Code: Select all

Set Variable ISWIN64 to FALSE
Get System Setting Windows in 64 bit Mode into ISWIN64
if Variable ISWIN64 Equals TRUE
 Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end

* By default a setup process runs natively as 32 bit mode and if you are installing a native 64 bit application on a x6 target, it is necessary to explicitly set the "Set x64 Mode" statement ... otherwise it fails to install and to register correctly (if Self Registering).

Then to install your files;

Code: Select all

if Variable ISWIN64 Equals TRUE
   Install Files ..\xxx64.dll to $TARGETDIR$\Driver\x64
else
   Install Files ..\xxx32.dll to $TARGETDIR$\Driver\x86
 end


Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

depalau
Posts: 5
Joined: Thu Mar 29, 2012 9:51 am

Re: 32-bit vs. 64-bit Installation

Postby depalau » Fri Apr 11, 2014 11:44 am

Hi Francesco, thanks for the response. Just an additional clarification question...if you look at the code generated by the native temple you see something like this:

Code: Select all

Comment: Initialize Setup Globals
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, 2012) into ISNT
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
if Variable SHORTCUTFILESALL Equals
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into SYSTEM32
Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
Get Folder Location System->System Directory into SYSWOW64
Get Folder Location System->Program Files Directory into PROGRAMFILES_X86
Get Common Folder Location System->Program Files Directory into COMMONFILES_X86
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR


It seems like the Set x64 statement is being called multiple times already. I don't need to call it again do I? What I then do is something like this:

Code: Select all

Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
 
if Variable ISWINDOWS64BIT Equals TRUE
  Set Variable WINSYSDIR to $SYSWOW64$
  else
  Set Variable WINSYSDIR to $SYSTEM32$
end


..and then in the installation section:

Code: Select all

Install Files ..\Dependencies\MSCOMCT2.OCX to $WINSYSDIR$ (Permanent, Never Overwrite)


Are you saying that Set x64 has to be called to determine how the "File is Self Registering DLL" is going to behave (either run RegSvr32 from System32 or SysWOW64)?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: 32-bit vs. 64-bit Installation

Postby FrancescoT » Mon Apr 14, 2014 8:58 am

Dear User,

In your case, you only need to call "Set x64 Mode" statement one time (...as my previous sample) and this instructs the process, that a native x64 bit application is going to be installed.

The "Set x64 Mode" statement controls various aspects that are specific under x64 Platform, as, registry entries, target paths and so on (... including the Self Registering DLL process as well).

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

depalau
Posts: 5
Joined: Thu Mar 29, 2012 9:51 am

Re: 32-bit vs. 64-bit Installation

Postby depalau » Mon Apr 14, 2014 12:04 pm

Hi Francesco,

I apologize for not being clearer...I'm not installing any application, simply a 32-bit DLL, regardless of the architecture of the OS. I was trying to figure out the best place/practice to put this 32-bit file when installing to either a Windows 64-bit OS or a Windows 32-bit OS. From my understanding this 32-bit file needs to go to SysWOW64 when installing on a 64-bit OS and System32 when installing on a 32-bit OS.

That said, I think that I have the answer to my question and that I need to call "Set x64 Mode" when detecting a Windows 64-bit OS. I was just confused by what the Native InstallAware Template does: it seems to put multiple "Set Win32" and "Set x64" statements in the template code (prior to me adding anything).

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: 32-bit vs. 64-bit Installation

Postby FrancescoT » Tue Apr 15, 2014 11:13 am

Dear User,

... but if you are installing a native 32 bit application or a native 32 bit DLL, you don't need to do anything!

As I already said previously;
By default a setup process runs natively as 32 bit mode and if you are installing a native 64 bit application on a x64 target, it is necessary to explicitly set the "Set x64 Mode" statement ... otherwise it fails to install and to register correctly (if Self Registering).

Finally, if you are installing a native 32 bit application / DLL on a x64 target OS, you don't have to use "Set x64 Mode" or "Set x32 Mode" statements.

I hope this finally clarify your doubt.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

depalau
Posts: 5
Joined: Thu Mar 29, 2012 9:51 am

Re: 32-bit vs. 64-bit Installation

Postby depalau » Tue Apr 15, 2014 12:11 pm

Understood on not having to call Set x64 or Set Win32.

Maybe I am complicating things, but don't you have to put the 32-bit DLL file in Windows/System32 if installing on a 32-bit OS and in Windows/SysWOW64 if installing on a 64-bit OS? And then call RegSvr32 (via the self-registering option) from the appropriate System32 or SysWOW64 location?


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 105 guests