Fix crash when starting from non ASCII path #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a crash that occurs when the launcher is started from a folder whose absolute path does contain non ASCII characters. This was due to the use of the WshRuntimeLibrary (a wrapper around COM libraries) that does not handle Unicode (as far as my deductions go). When assigning the target path to the shortcut object, the runtime would error.
This commit replaces the WshRuntimeLibrary with a COM wrapper around the IShellLink interface, using its Unicode oriented functions.
The WshRuntimeLibrary is removed from dependencies and the .NET framework is updated to 4.8 as 4.0 has reached EOL.
Tested on: Win10 64-bits.
Warning: The code is taken from https://stackoverflow.com/a/14632782 As you can see from the comments, some people argue this does not work on all versions of Windows, possibly something tied to 32 / 64 bits. Further testing on other Win versions and archs is probably required