If-then-else

Jul 22, 2011 at 11:50 AM
Edited Jul 22, 2011 at 11:52 AM

I need to support MUI-translated Windows XP in my installer. MUI works like this:

  • You install Windows in English
  • Then you install the MUI translation pack for, say, French
  • From the user and registry point of view, a MUI-translated Windows looks like an actual Windows in the translated language. There is nothing in the registry or in Add/Remove Programs which tells you MUI is installed. The only way to notice this is by looking for .mui files in C:\Windows, C:\Windows\system32, etc.
  • Patches (Windows Updates) must still be installed in English, not in French

For my application, I need to install the Remote Desktop 7.0 client in the computer.

I was telling dni to install "#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-@[HKEY_CURRENT_USER\Control Panel\International\sLanguage,enu].exe" but it fails because in MUI-translated Windows, that registry key does not return "enu" but the translation ("fra", "esn", etc).

To solve this, I am trying to implement something like this with check conditions:

 

if( WindowsXP && && RDP7notInstalled && MUItranslated) {
    install WindowsXP-KB969084-x86-enu.exe
} else {
    install #CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-@[HKEY_CURRENT_USER\Control Panel\International\sLanguage,enu].exe
}

 

This is the code relevant part of the XML config, which does not work:

<component executable="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-enu.exe" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="/quiet" exeparameters_basic="/quiet" exeparameters_silent="/quiet" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id="Remote Desktop 7.0 (KB969084)" display_name="Remote Desktop 7.0 (KB969084)" uninstall_display_name="" os_filter="" os_filter_min="" os_filter_max="" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <installedcheckoperator type="And" description="If WinXP and RDP 7.0 is not installed and MUI-translated, install ENU patch">
        <installedcheck path="SOFTWARE\Microsoft\Windows NT\CurrentVersion" fieldname="ProductName" fieldvalue="Microsoft Windows XP" defaultvalue="False" fieldtype="REG_SZ" comparison="contains" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Check for Windows XP" />
        <installedcheck filename="#SYSTEMWINDOWSPATH\$NtUninstallKB969084$\mstsc.exe" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="RDP 7.0 installed?" />
        <installedcheck filename="#SYSTEMWINDOWSPATH\system32\ieframe.dll.mui" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="Check MUI-translated Windows installation" />
      </installedcheckoperator>
      <embedfile sourcefilepath="#APPPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-enu.exe" targetfilepath="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-enu.exe" />
    </component>
    <component executable="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-@[HKEY_CURRENT_USER\Control Panel\International\sLanguage,enu].exe" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="/quiet" exeparameters_basic="/quiet" exeparameters_silent="/quiet" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id="Remote Desktop 7.0 (KB969084)" display_name="Remote Desktop 7.0 (KB969084)" uninstall_display_name="" os_filter="" os_filter_min="" os_filter_max="" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="False" required_uninstall="False" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <installedcheckoperator type="And" description="If WinXP and RDP 7.0 is not installed and NOT MUI-translated, install language-specific patch">
        <installedcheck path="SOFTWARE\Microsoft\Windows NT\CurrentVersion" fieldname="ProductName" fieldvalue="Microsoft Windows XP" defaultvalue="False" fieldtype="REG_SZ" comparison="contains" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Check for Windows XP" />
        <installedcheck filename="#SYSTEMWINDOWSPATH\$NtUninstallKB969084$\mstsc.exe" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="RDP 7.0 installed?" />
        <installedcheckoperator type="Not" description="NOT MUI-translated">
          <installedcheck filename="#SYSTEMWINDOWSPATH\system32\ieframe.dll.mui" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="Check MUI-translated Windows installation" />
        </installedcheckoperator>
      </installedcheckoperator>
      <embedfile sourcefilepath="#APPPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-enu.exe" targetfilepath="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-enu.exe" />
      <embedfile sourcefilepath="#APPPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-esn.exe" targetfilepath="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-esn.exe" />
      <embedfile sourcefilepath="#APPPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-fra.exe" targetfilepath="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-fra.exe" />
      <embedfile sourcefilepath="#APPPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-deu.exe" targetfilepath="#CABPATH\Microsoft_Updates\XP\WindowsXP-KB969084-x86-deu.exe" />
    </component>

What happens is dni tries to install KB969084 twice: first the English version, then the localized version, which tells me the "and not exist #SYSTEMWINDOWSPATH\system32\ieframe.dll.mui" check is not working as I expected.

Could someone please point me to the mistake?

Thank you.

Coordinator
Jul 22, 2011 at 1:44 PM

Examine the log for whether the conditional evaluation. 

These conditions are the opposite of what you expect - they indicate when a component IS installed. So the first should evaluate to true if !WindowsXP or RDP7Installed or MUItranslated. Get that working properly for one component and then simply invert that condition for the second.