At the command prompt, type the following:

ILProtector [*.ilproj] [options] [<assembly>] [<other assemblies>...]

 

Parameters

Argument Description
*.ilproj ILProtector project file path. You can specify a full or relative path.
<assembly> The explicit path of the assembly. You can specify a full or relative path.
<other assemblies>... You can specify more than one assembly. The explicit paths of the assemblies. You can specify full or relative paths.
Option Description
-out=<dir> Output directory for protected assemblies.
-nogui If *.ilproj is specified, processes project in console mode.
-sign Re-signs a previously signed assembly(ies) with the public/private key pair in keyfile.
-keyfile=<file> Specifies a file that contains a public/private key pair to sign an assembly(ies).
-verify Check the MSIL and metadata for all assemblies.
-quiet Quiet mode, suppresses any output other than error messages.
-nologo Don't display product version and copyright info.
-options Show ILProtector options.
-name32=<name> Specifies x86 dll name.
-name64=<name> Specifies x64 dll name.
-embed-dlls Embed Protect DLLs into assemblies.
-encryptstrings Encrypts the assembly(ies) user strings.
-integrity Enable Integrity for assembly(ies).
-loadfromfile Enable LoadFromFile option for assembly(ies).
-update Check for ILProtector updates and install if available. If the process does not have administrative privileges, the UAC prompt appears for the installation.
-noprompt Used with -update option. The UAC prompt does not appear and the installation might fail due to insufficient permissions on the installation directory.
-?, -h Displays command syntax and options for the tool.

Remarks

When -update option is used, if a new version is available, the application downloads update, runs installation process and returns ExitCode=2, in other cases return code is 0 (success, no new version available) or non-zero (an error occurred).

When -update option is used in script, please wait a few seconds until a new version is installed and then continue execution, for example:

@echo off
echo Check and install updates if available without UAC prompt
ILProtector.exe -update -noprompt
IF %ERRORLEVEL% == 0 GOTO Next
IF %ERRORLEVEL% == 2 GOTO Wait
:Fail
echo Execution Failed
GOTO End
:Wait
echo Wait 10 seconds until a new version is installed (recommended 3-60 sec)
rem TIMEOUT /t 10 /NOBREAK > NUL
ping -n 11 127.0.0.1 > NUL
:Next
echo Continue execution
ILProtector -encryptstrings -integrity Product.exe
:End

 

Examples

  ILProtector myproject.ilproj -nogui
  ILProtector Product.exe
  ILProtector -out="Bin" -sign -keyfile="key.snk" -verify App.exe Library.dll
  ILProtector -update -noprompt
  ILProtector Product.exe -integrity -loadfromfile -encryptstrings -embed-dlls