Using "RegisterFileType" in Qt Installer Framework
-
I'm trying to create an installer that register a file extension. So I'm using the following commnad in my install script:
@component.addOperation("RegisterFileType", "prp", "@TargetDir@/@ProductName@.exe");@
But how can I provide the file being opened to my application? I didn't found anything in the "documentation":http://qt-project.org/doc/qtinstallerframework-1.5/operations.html
-
I also would like to know how to provide an icon. The "registerfileextension" example do this:
@component.createOperations();
var iconId = 0;
var notepadPath = installer.environmentVariable("SystemRoot") + "\notepad.exe";var isRegisterFileChecked = component.userInterface("RegisterFileCheckBoxesForm").RegisterFileCheckBox.checked; if (installer.value("os") === "win") { component.addOperation("RegisterFileType", component.unusalFileType, notepadPath + " '%1'", "QInstaller Framework example file type", "text/plain", notepadPath + "," + iconId, "ProgId=QtProject.QtInstallerFramework." + component.unusalFileType); } component.addOperation("Move", "@TargetDir@/registeredfile", component.registeredFile);@
But how can I provide my own ico file?
-
Ok. After digging a bit I found my answers.
- How to provide the file being opened to the command in "RegisterFileType"?
- '%1' like in the example above
- How to provide an icon for the file being registered
- The icon must be in "TargetDir" or it must be some default icon file.
-
-
Thanks for this post and answer!
Also interested in kiro's question.