Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.7
-
None
-
Windows 11 23H2
Description
File association does not work under Windows.
The command in the registry in Computer\HKEY_CLASSES_ROOT\Applications\Company.MyApp.ext\shell\Open\Command is:
C:/Program Files/Company/MyApp/myapp.exe "%1"
instead of:
C:\Program Files\Company\MyApp\myapp.exe "%1"
The forward slashes are invalid, this makes it unable to run, so double-clicking on a file of type ".ext" generates an error and does not open the application.
My installscript.qs is the following:
function Component() { } Component.prototype.createOperations = function() { component.createOperations(); if (systemInfo.productType === "windows") { component.addOperation("RegisterFileType","ext","@TargetDir@/myapp.exe \"%1\"","MyApp files","application/octet-stream", "@TargetDir@/myapp.exe,1","ProgId=Company.MyApp.ext"); } }
Editing the registry to fix the path with backslashes seem to fix this issue.
I've seen that there exists a function installer.toNativeSeparators(), but I don't understand how to use it here.
I've tried with backslashese in the script, but only the last folder changes.