How to tell UltraEdit Portable to use UltraCompare Professional Portable instead of built-in Lite version?

How to tell UltraEdit Portable to use UltraCompare Professional Portable instead of built-in Lite version?

33
NewbieNewbie
33

    Apr 12, 2022#1

    Does anyone know how to tell UltraEdit Portable to use UltraCompare Portable Pro when comparing files?

    When I try to use "Compare 2 files" from within UltraEdit portable, it does it using built-in Lite version of UltraCompare.
    I can use UC Pro  directly, by launching UC Pro Portable app  and opening files from there, but it would be so much more convenient to be able to do it from within UltraEdit.

    What is interesting, when I use UEP - from a stick - on a laptop where I also have a "regular" (not portable) version of UltraEdit and UltraCompare,  then from within UEP the compare action launches my UltraCompare Pro. 
    But not on a machine which does not have regular (non-portable) version of  UltraCompare Pro 

    The version I am using is UEP 28.20.0.70 and UltraCompare Pro 21.10.0.18

    TIA

      Apr 13, 2022#2

      Responding to my own question - in case it may benefit at least one other person who has to work on a server and has no admin rights and not-very-helpful IT department:

      The not ideal but a working solution is as follows:
      Step 1: make UltraCompare Pro Portable accessible from the Context menu of Windows Explorer. I did it by adding it to "sendTo" action (see below on how)
      Step 2: In UEP, in File Explorer view, select 2 files you want to compare
      Step 3: right click and Select System Explorer Menu, then click on Send To and select UC shortcut.
      This opens UC and loads the files there.

      To make UC Portable Pro available in SendTo, first create a shortcut to its executable. Then press windows key +R and type shell:senddto (thank you to whoever posted this tip elsewhere). This opens "sendTo" folder. Copy the shortcut to UCPro executable there.

      I wish there was a simpler way. But at least it is a workable solution for me.

      6,603548
      Grand MasterGrand Master
      6,603548

        Apr 13, 2022#3

        I have to mention first that I have neither UltraEdit Portable nor UltraCompare Portable and so could not test my solution with these two applications. I tested my solution with the non-portable versions UltraEdit and UltraCompare Professional.

        UltraEdit detects the availability of UltraCompare Professional by existence of its application registration. The application registration is done by the installers of UltraCompare, UltraEdit, UEStudio, ... The portable versions are used without the execution of an installer on the machine on which the USB stick with the executables is plugged in. For that reason there is no application registration done on the computer on which the portable versions are executed from the USB stick.

        It is of course possible to manually do a temporary registration of UltraCompare Professional for current user only so that UltraEdit Portable recognizes UltraCompare Professional Portable. There are two batch files required both stored also on the USB stick and executed from the USB stick.

        The first batch file is RegUC.cmd with just one long command line:

        Code: Select all

        @%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" >nul 2>nul || %SystemRoot%\System32\reg.exe ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /f /ve /t REG_SZ /d "%~d0\Path\UltraCompare\ucp.exe" >nul
        Please note that the part Path\UltraCompare\ucp.exe in the command line must be adapted with correct path and file name of the executable of UltraCompare Professional Portable on the USB stick. %~d0 references drive letter and colon of the batch file containing this line. So the drive letter assigned by Windows to the USB stick is used automatically on registering UC.

        There is registered uc.exe (non-portable UltraCompare Professional) with the fully qualified file name of UltraCompare Professional Portable as that is the registry key searched also by UltraEdit Portable according to the information provided in the first post of this topic.

        This batch file first checks if there is no registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe and if this condition is true, it adds the registry key with the default string value being the fully qualified file name of the executable of UltraCompare Professional Portable on the USB stick. If there is by chance already an application registration for UltraCompare Professional in registry hive of current user on host machine, this application registration is kept as is.

        The second batch file is UnRegUC.cmd with following command lines:

        Code: Select all

        @echo off
        %SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /ve 2>nul | %SystemRoot%\System32\find.exe /I "%~d0\Path\UltraCompare\ucp.exe" >nul || exit /B
        %SystemRoot%\System32\reg.exe DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /f >nul 2>nul
        for /F "delims=" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths" 2^>nul') do exit /B
        %SystemRoot%\System32\reg.exe DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths" /f >nul 2>nul
        
        Please note that the part Path\UltraCompare\ucp.exe in the second command line must be adapted with correct path and file name of the executable of UltraCompare Professional Portable on the USB stick.

        This batch file first checks if the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe exists and the default string value has the string which is stored in RegUC.cmd. Otherwise the batch file execution is exited as there is an application registration of UltraCompare on the host machine which was not done by RegUC.cmd.

        In case of UltraCompare Professional Portable on USB stick is indeed currently registered in registry hive of current user, the registry key is deleted by this batch file. There is additionally checked if there is next nothing under key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths in which case this empty registry key is also deleted to restore the initial registry data completely.

        The registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths does by default not exist. Most applications are installed for all users using the special trusted installer account or an administrator account and therefore register the installed application in registry hive of local machine, i.e. under registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths (64-bit applications on 64-bit Windows, 32-bit applications on 32-bit Windows) or HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths (32-bit applications on 64-bit Windows). 32-bit or 64-bit registry path does not make any difference since Windows 7 as described by the Microsoft documentation page about Registry Keys Affected by WOW64 because of being shared between the 32-bit and 64-bit execution environments. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths is used by installers only if an application is explicitly installed for current user only which the installers of UltraEdit and UltraCompare also support.

        The batch file RegUC.cmd must be executed  from the USB stick before opening in UltraEdit the Compare Files/Folders window. The batch file UnRegUC.cmd must be executed before plugging off the USB stick from the host machine.
        Best regards from an UC/UE/UES for Windows user from Austria

        33
        NewbieNewbie
        33

          Apr 14, 2022#4

          Thank you Mofi!
          I was afraid that without messing with registry it is not easily done.
          Your reply is very informative.
          I am just  afraid to go this route, if IT gets a whiff that I am messing with registry, even temprarily, they may take away my encrypted stick (which is the only way to go around server  access restrictions).
          But just for my own benefit, I will try this on a friend's laptop w/out UEP/UEC installed.