Problem with if Variable contains String

Got a problem you cannot solve? Try here.
Post Reply
Seán
Posts: 13
Joined: Wed Nov 13, 2013 10:24 am

Problem with if Variable contains String

Post by Seán »

Hi there,

I've tried everything to get this to work but now need assistance...

Code: Select all

Check Registry Key HKLM\SOFTWARE\Classes\Excel.Addin\shell\Open\command\ into Office_x86_or_x64
if Variable Office_x86_or_x64 Contains (Ignore Case) "x86"
    Set Variable OfficeX86 to TRUE
else
    Set Variable OfficeX86 to FALSE
end
No matter on which machine and Office I always get FALSE.

On my Office x86 system the output from the Installer (Write to File) shows I have a x86 service, but how do I get the comparison to correctly test for the string? I've tried without the double quotes - same result...

Code: Select all

Office_x86_or_X64="C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" /dde
OfficeX86=FALSE
Many thanks in advance,
Best regards
Seán
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Problem with if Variable contains String

Post by bokkie »

Try this:

Code: Select all

Set Variable Office_x86_or_x64 to FRED
MessageBox: , $Office_x86_or_x64$
Check Registry Key HKLM\SOFTWARE\Classes\Excel.Addin\shell\Open\command\command into Office_x86_or_x64
MessageBox: , $Office_x86_or_x64$
if Variable Office_x86_or_x64 Contains (Ignore Case) x86
 Set Variable Office_x86_or_x64 to TRUE
 else
 Set Variable Office_x86_or_x64 to FALSE
end
MessageBox: , $Office_x86_or_x64$
On my machine the command value is in the registry subnode called command. That works for me! To be honest, the value itself doesn't look like much but it is displayed in the message box all the same.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Problem with if Variable contains String

Post by FrancescoT »

Dear Seán,

by th way, are you calling "Set x64 - Native 64 bit Windows ... " before accessing to those keys?

Are you sure them are not stored under the respective "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes", if the package has been installed as native 32 bit on a x64 System?

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
Post Reply