Default value for "Destination Folder" in x64 install

Got a problem you cannot solve? Try here.
Enginerd
Posts: 17
Joined: Thu Aug 27, 2015 1:48 pm

Default value for "Destination Folder" in x64 install

Postby Enginerd » Tue Oct 13, 2015 7:35 pm

I have a product with an x86 version ("Product-x86") and an x64 version ("Product-x64"),
each having a separate installer. The InstallAware project for "Product-x86" and for
"Product-x64" were both created using InstallAware's "New Project" ->
"Windows Installer, Win64 Setup". The "Product-x64" InstallAware project has the
"Application Requirements" -> "Special Requirements" option "64 bit operating system"
checked, while the "Product-x86" InstallAware project does not.

The "Product-x86" installer has "Target Folder" set to "$PROGRAMFILES_X86$\Company\Product",
such that during installation, the screen for "Destination Folder" defaults to the folder
"C:\Program Files (x86)\Company\Product" which is exactly as expected. All good so far.

The "Product-x64" installer has "Target Folder" set to "$PROGRAMFILES$\Company\Product",
but during installation, the screen for "Destination Folder" also defaults to the folder
"C:\Program Files (x86)\Company\Product" -- which is not what I would expect!

As a result, when our users install both products, if the users just click "Next" on every
page and use the defaults (which is of course what nearly everyone always does), the
one product ends up overwriting the other product. This is a show stopper problem
for our product release.

Of course, if our users carefully watch the x64 installer and manually change
the "Destination Folder" back to "C:\Program Files\Company\Product", everything
works just fine. So the only problem is the default value on an x64 install.

When the "Special Requirements" -> "64 bit operating system" option is set, the
default for "Destination Folder" should be "C:\Program Files" not "C:\Program Files (x86)".
--This message was written using 73% post-consumer electrons--

Enginerd
Posts: 17
Joined: Thu Aug 27, 2015 1:48 pm

Re: Default value for "Destination Folder" in x64 install

Postby Enginerd » Tue Oct 13, 2015 8:15 pm

After further testing.... When the 64 bit product is NOT yet installed,
the default value appears to be correct.

When the 64 bit product is already installed, and I go to install a new
version of the 64 bit product, beginning with using the InstallAware installer
to uninstall the older version, and then proceeding into an install of the new
version, the value for the default "Destination Folder" is reproducibly incorrect,
as described.

So to clarify my initial report, this seems to only happen with the 64 bit
product when using the InstallAware installer for a new product release
to do an uninstall of an older version, followed by an install of a new version.
--This message was written using 73% post-consumer electrons--

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

Re: Default value for "Destination Folder" in x64 install

Postby FrancescoT » Wed Oct 14, 2015 12:25 pm

Dear Enginered,

I suggest you to have a look at following topic. It should solve your problem.
http://www.installaware.com/forum/viewtopic.php?f=2&t=8492

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

Enginerd
Posts: 17
Joined: Thu Aug 27, 2015 1:48 pm

Re: Default value for "Destination Folder" in x64 install

Postby Enginerd » Wed Nov 04, 2015 9:00 pm

FrancescoT wrote:Dear Enginered,

I suggest you to have a look at following topic. It should solve your problem.
http://www.installaware.com/forum/viewtopic.php?f=2&t=8492

Regards


I finally got a chance to revisit this problem. And your recommendation does
NOT solve the problem. My installer already contains all of this logic. As I
described, the install works perfectly, selecting the correct Destination Folder
for the platform when performing an install. But it selects the incorrect
Destination Folder for x64 when the user first runs an uninstall previous
version before proceeding (without exiting) to install the new version.

It seems that when running an uninstall and then an install, the variable for
the "x64 - Native 64 bit Windows, AMD64 and EM64T Architectures" is somehow
being cleared internally before the install gets a chance to run. This appears
to be to be an unresolved bug in InstallAware X3.
--This message was written using 73% post-consumer electrons--

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

Re: Default value for "Destination Folder" in x64 install

Postby FrancescoT » Thu Nov 05, 2015 12:44 pm

Dear Enginered,

I suppose instead that there is something wrong with your script code.
I have released dozens of projects and I never had a similar issue.
Of course, you have to handle the "set x64" mode correctly.

If you have any chance to post a "VERY MINIMAL" project that demonstrates the issue I'll have a look.

Alternatively, you may send it to; support@installaware.com

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

Enginerd
Posts: 17
Joined: Thu Aug 27, 2015 1:48 pm

Re: Default value for "Destination Folder" in x64 install

Postby Enginerd » Thu Nov 05, 2015 4:38 pm

FrancescoT wrote:Dear Enginered,

I suppose instead that there is something wrong with your script code.
I have released dozens of projects and I never had a similar issue.
Of course, you have to handle the "set x64" mode correctly.

If you have any chance to post a "VERY MINIMAL" project that demonstrates the issue I'll have a look.

Alternatively, you may send it to; support@installaware.com

Regards


I just sent a link via your web support contact form, with a link so
you can download a minimal project I assembled which demonstrates
the problem. Rather than installing our product, this installs a copy
of notepad.exe. I tried to send the link via email, but your mail
server rejected the email. Oh well.


Steps to reproduce:

  • Rebuild the project, generate the installer, and then
    install the product. As an x64 project, the correct default
    value for "Destination Folder" is properly under "C:\Program Files\"
    and the install works as expected.

  • Make a new build of the project.

  • Install the new build.

  • It will now offer to uninstall the prior version. Proceed with uninstall.

  • After the uninstall completes, it immediately proceeds to
    install as expected. The default value for "Destination Folder"
    however is now set to "C:\Program Files (x86)\" which is incorrect.

  • It appears that the setting for variable
    "x64 - Native 64 bit Windows, AMD64 and EM64T Architectures"
    may be getting cleared during uninstall and before install. If
    so, perhaps other variables are also being cleared. Worth checking.

  • At this point, press "Cancel" to abort the install rather than
    proceeding with the install.

  • Run the install again. It does not run the uninstall
    this time (since the project has already been removed),
    and thus yhe correct default value for "Destination Folder"
    is once again properly set under "C:\Program Files\"

We have had several customers use the uninstall/reinstall
feature with our x64 product, accepting all defaults, and
thus end up with an unusable install with files getting
installed improperly to "C:\Program Files (x86)\" and
thus with a broken product.
--This message was written using 73% post-consumer electrons--

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

Re: Default value for "Destination Folder" in x64 install

Postby FrancescoT » Mon Nov 09, 2015 7:52 am

Dear Enginered,

the problem you reported is directly caused by the way you used to implement the "set x64" and "Set win 32" mode switches in your scripts.
More precisely, in your main script you included the "checknet452_x86x64" script which always sets the setup mode to "win32". This script is placed within the "Install setup pre-requisites [CODE REGION]" and executed conditionally ONLY when the "PREREQ" pre-defined variable is TRUE.

NOTE! By default, the value of the "PREREQ" pre-defined variable is conditionally controlled by the "NEEDSUPGRADE" pre-defined variable, which is TRUE if a previous version of the product was found installed using the Windows Installer Engine.

Consequently and due the above approach, the "checknet452_x86x64" is never executed the first time the product is installed and due of this, the "PROGRAMFILES" (pre-defined variable) will correctly point to the x64 location of the "Program Files" folder. Instead the "opposite" happens when a previous version is found installed on the system.

!The "PROGRAMFILES" (pre-defined variable) is assigned in the "Define Setup Globals [CODE REGION]" and its used to set the value of the "TARGETDIR"!

That said and because for what I see you allow to install your package on a x64 Target OS only, you should;
- include the "checknet452_x86x64" script within the "Check setup pre-requisites [CODE REGION]" in order to execute it properly at first install time.
- remove the "Set win 32" mode statement from the "checknet452_x86x64" script.

Please note that generally the recommended place where to "CONDITIONALLY" switch the "set x64" and "Set win 32" modes in the main script code, it's at the very beginning of the "Define Setup Globals [CODE REGION]". This assures the best results especially when handling a hybrid x86/x64 installer. This because if an Application Runtime has been included with the project", the respective "check" script automatically included, it will revert back to "win32" always when executed on a x64 target and this due the fact, that WIN32 is the default MSI engine operation mode.

Hope this helps you.

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 93 guests