Page 1 of 1

XYplorer issue with icons from 64bit apps

Posted: 07 Jul 2016 18:47
by cadu
Hi,

I would appreciate help:

My screen-recording shows XYplorer and Windows Explorer side-by-side showing same folder and the issue detailed below: https://goo.gl/sk9sHR

The folder content has shortcuts to many apps, but all apps that are 64bit don't have their icons showed by XYplorer properly.

Also, when I double click the app icon, XYplorer shows an error that "the specified path does not exist". However, if I do the same through Windows Explorer, the icon is showed properly and the app does run, as registered in the screen-recording.

Is there any setting/workaround in order XYplorer can show the icon and also launch the application without error?

Thanks,
Cadu_

Re: XYplorer issue with icons from 64bit apps

Posted: 07 Jul 2016 19:05
by TheQwerty
I didn't watch the video but from your description I would bet that the problem is the shortcuts incorrectly use the %ProgramFiles% environment variable to reference their target.

This variable changes based on the bitness of the running process (not the target application). In Windows Explorer, which is 64-bit, it typically resolves to C:\Program Files but in 32-bit processes like XYplorer it will resolve to C:\Program Files (x86).

These shortcuts need to be modified or recreated to use the variable that correctly references their target:
%ProgramFiles(x86)% = C:\Program Files (x86)
or
%ProgramW6432% = C:\Program Files

Take note that the Properties dialog may show the variable resolved even if the shortcut actually uses the variable which is a giant annoyance from Microsoft.


You can read some past threads on the topic for more details:
viewtopic.php?f=2&t=15621
viewtopic.php?f=2&t=14014
viewtopic.php?f=5&t=12937
viewtopic.php?f=2&t=4097

Re: XYplorer issue with icons from 64bit apps

Posted: 07 Jul 2016 23:07
by cadu
Problem was that. Solved.
Thanks TheQwerty

Re: XYplorer issue with icons from 64bit apps

Posted: 07 Jul 2016 23:30
by highend
A small "repair" script...
It looks for all .lnk files (recursively) inside the current directory and rewrites their target
to %ProgramW6432% if the destination does not exist in %ProgramFiles(x86)%.

It's (currently) meant only for x64 operating systems....

Not heavily tested^^

Code: Select all

    if (%osbitness% != 64) { end 1==1; }

    setting "BackgroundFileOps", 0;

    $envVar = "Program Files \(x86\)";
    $shortcuts = quicksearch("*.lnk");
    foreach($shortcut, $shortcuts, <crlf>) {
        $lnkTarget = property("#ShortcutTarget", $shortcut);
        if (regexmatches($lnkTarget, $envVar)) {
            if (exists($lnkTarget)) { continue; }
            $lnkTarget = regexreplace($lnkTarget, "^.*?$envVar", '%ProgramW6432%');
            delete 1, 0, $shortcut;
            new($shortcut, "link", $lnkTarget);
        }
    }

Re: XYplorer issue with icons from 64bit apps

Posted: 17 Dec 2021 19:38
by kunkel321
Highend's link fixer script was so useful that it deserves its own toolbar button image... 8)
Link Fixer.png