@@ -2166,14 +2166,20 @@ def create_custom_desktop_entry(self, installer_path, app_name):
21662166
21672167 wine = Path (self .directory ) / "ElementalWarriorWine" / "bin" / "wine"
21682168
2169+ # Normalize all paths to strings to avoid double slashes
2170+ wine_str = str (wine )
2171+ directory_str = str (self .directory ).rstrip ("/" ) # Remove trailing slash if present
2172+ exe_path_normalized = exe_path .replace ("\\ " , "/" ) # Normalize Windows paths
2173+
21692174 with open (desktop_file , "w" ) as f :
21702175 f .write ("[Desktop Entry]\n " )
21712176 f .write (f"Name={ app_name } \n " )
21722177 f .write (f"Comment={ app_name } installed via Affinity Linux Installer\n " )
21732178 if icon_path :
2174- f .write (f"Icon={ icon_path } \n " )
2175- f .write (f"Path={ self .directory } \n " )
2176- f .write (f'Exec=env WINEPREFIX={ self .directory } { wine } "{ exe_path } "\n ' )
2179+ icon_path_str = str (icon_path ).rstrip ("/" )
2180+ f .write (f"Icon={ icon_path_str } \n " )
2181+ f .write (f"Path={ directory_str } \n " )
2182+ f .write (f'Exec=env WINEPREFIX={ directory_str } { wine_str } "{ exe_path_normalized } "\n ' )
21772183 f .write ("Terminal=false\n " )
21782184 f .write ("Type=Application\n " )
21792185 f .write ("Categories=Application;\n " )
@@ -2517,13 +2523,19 @@ def create_desktop_entry(self, app_name):
25172523 app_path = Path (self .directory ) / "drive_c" / "Program Files" / "Affinity" / dir_name / exe
25182524 icon_path = Path .home () / ".local" / "share" / "icons" / icon
25192525
2526+ # Normalize all paths to strings to avoid double slashes
2527+ wine_str = str (wine )
2528+ app_path_str = str (app_path ).replace ("\\ " , "/" ) # Ensure forward slashes for Windows paths in Wine
2529+ directory_str = str (self .directory ).rstrip ("/" ) # Remove trailing slash if present
2530+ icon_path_str = str (icon_path )
2531+
25202532 with open (desktop_file , "w" ) as f :
25212533 f .write ("[Desktop Entry]\n " )
25222534 f .write (f"Name=Affinity { name } \n " )
25232535 f .write (f"Comment=A powerful { name .lower ()} software.\n " )
2524- f .write (f"Icon={ icon_path } \n " )
2525- f .write (f"Path={ self . directory } \n " )
2526- f .write (f'Exec=env WINEPREFIX={ self . directory } { wine } "{ app_path } "\n ' )
2536+ f .write (f"Icon={ icon_path_str } \n " )
2537+ f .write (f"Path={ directory_str } \n " )
2538+ f .write (f'Exec=env WINEPREFIX={ directory_str } { wine_str } "{ app_path_str } "\n ' )
25272539 f .write ("Terminal=false\n " )
25282540 f .write ("Type=Application\n " )
25292541 f .write ("Categories=Graphics;\n " )
0 commit comments