XYplorer issue with icons from 64bit apps

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
cadu
Posts: 287
Joined: 18 Mar 2012 21:50

XYplorer issue with icons from 64bit apps

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

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: XYplorer issue with icons from 64bit apps

Post 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

cadu
Posts: 287
Joined: 18 Mar 2012 21:50

Re: XYplorer issue with icons from 64bit apps

Post by cadu »

Problem was that. Solved.
Thanks TheQwerty

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: XYplorer issue with icons from 64bit apps

Post 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);
        }
    }
One of my scripts helped you out? Please donate via Paypal

kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: XYplorer issue with icons from 64bit apps

Post by kunkel321 »

Highend's link fixer script was so useful that it deserves its own toolbar button image... 8)
Link Fixer.png
To see the attached files, you need to log into the forum.
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

Post Reply