Search code examples
registryinstallationnsis

NSIS registry:Write not writing all of the value needed


I have this line of code

${registry::Write} "HKEY_CLASSES_ROOT\autodocedithandler\shell\open\command" "" "$PROGRAMFILES32\AutoDocEdit\AutoDocEdit.exe $\"%1$\"" "REG_EXPAND_SZ" $R0

When I run the installer and check the registry afterwards I see that only the '%1' has been entered to the registry as the value - the path before did not make it.

Any reason?

Thanks


Solution

  • I eventually solved this by using a definition for the folder

    !define DefaultAutoDocEditFolder "$PROGRAMFILES32\AutoDocEdit\AutoDocEdit.exe"
    

    and later using like this

    ${registry::Write} "HKEY_CLASSES_ROOT\autodocedithandler\shell\open\command" "" '${DefaultAutoDocEditFolder} "%1"' "REG_EXPAND_SZ" $R0
    

    Hope this solution helps someone else.