InnoSetup Pass License Key as Custom Parameter

Posted on August 22, 2020 at 11:44 am

Place this code inside CurStepChanged() within ssPostInstall step:

//allow usage of command-line parameter /LICENSEKEY=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
//and copy the key in a file license.key in installation folder
if ExpandConstant('{param:licensekey|none}') <> 'none' then
    SaveStringToFile(ExpandConstant('{app}')+'\license.key', ExpandConstant('{param:licensekey|none}'), False);

So then you can run the setup.exe like this:


A file named license.key containing the submitted key will be saved in the installation folder.

Useful to auto-activate a product via setup.exe command-line.

Receive updates via email

Other Posts

Updated Posts