Use "[#IdentifierOfExeFile]". That's a formatted string and will be replaced with the full path to the target file with specified id. See http://msdn.microsoft.com/en-us/library/aa368609%28v=vs.85%29.aspx for the full list of options with formatted strings.
How to add key in registry during setup that points to location of installed EXE
-
25-06-2023 - |
Pergunta
I'm working with Wix 3.7 and as part of the installation of an app I'm working on I need to add a custom shell action to invoke the application for certain file extensions.
Basically, I need to add a key under the shell
sub-key of certain extensions under the HKEY_CLASSES_ROOT root tree in the Registry.
I've figured out how to add the key but I haven't been able to modify the value of the key dynamically to point to the exe being installed.
This is what I have:
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryEntries" Guid="PUT-GUID-HERE">
<RegistryKey Root="HKCR"
Key="txt\shell\MyApplicationName"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="SOME_VALUE" KeyPath="yes"/>
</RegistryKey>
</Component>
</DirectoryRef>
Essentially, instead of SOME_VALUE
I would like it to reference the install folder and the name of the application's EXE, followed by some switches and a parameter. Something like this:
"C:\Program Files\MyAppFolder\MyAppExe.EXE" /a /b "%1"
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow