Page 1 of 1

Problem with if Variable contains String

Posted: Sun Dec 01, 2013 6:33 am
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

Re: Problem with if Variable contains String

Posted: Sun Dec 01, 2013 12:42 pm
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.

Re: Problem with if Variable contains String

Posted: Mon Dec 02, 2013 11:49 am
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