anchor.diff:      )
   
       set certificate=%signsis1%
  -    signsis %basename%.sis %basename%.sisx %signsis1% %signsis2% %signsis3%
  +    signsis %unsigned_sis_name% %signed_sis_name% %signsis1% %signsis2% %signsis3%
   )
   
   :install
  -if exist %basename%.sisx (
  -    echo Successfully created %basename%.sisx using certificate %certificate%
  -    if "%installsisx%" == "true" (
  -        echo Installing %basename%.sisx...
  -        call %basename%.sisx
  +if exist %signed_sis_name% (
  +    echo Successfully created %signed_sis_name% using certificate %certificate%
  +    if "%installsigned%" == "true" (
  +        echo Installing %signed_sis_name%...
  +        call %signed_sis_name%
       )
   )
   
   :cleanup
  -if exist %basename%.sis del %basename%.sis
  +if exist %unsigned_sis_name% del %unsigned_sis_name%
   
  -:done+:done
  +
  +set installsigned=%installsigned_old%
  +set pkgfile=%pkgfile_old%
  +set basename=%basename_old%
  +set signsis1=%signsis1_old%
  +set signsis2=%signsis2_old%
  +set signsis3=%signsis3_old%
  +set unsigned_sis_name=%unsigned_sis_name_old%
  +set signed_sis_name=%signed_sis_name_old%
  +set scriptpath=%scriptpath_old%
  +set certificate=%certificate_old%
  
positive.code:     set signsis3=%4
  )
  
  rem Check the .pkg actually exists.
  if not exist %pkgfile% (
      echo Error: Package description file '%pkgfile%' does not exist.
      goto done
  )
  
  rem Get absolute path to this script
  set scriptpath=%~dp0
  
  rem Remove any existing .sis or .sisx packages
  if exist %basename%.sis del %basename%.sis
  if exist %basename%.sisx del %basename%.sisx
  
  rem Create .sis package
  makesis %pkgfile%
  
  rem If no certificate is given, check default options
  if x%signsis1% == x (
      rem If RnD certificate is not found, sign with self signed certificate
      if not exist %scriptpath%..\rd.cer (
          set certificate=Self signed
          signsis %basename%.sis %basename%.sisx %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key
          goto install
      )
  
      rem Sign with RnD certificate
      set certificate=RnD
      signsis %basename%.sis %basename%.sisx %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem
  ) else (
      if x%signsis2% == x (
         echo Custom certificate key file parameter missing.
  
negative.code: )
  
  if "%1"=="-i" (
      set installsigned=true
      set pkgfile=%2
      set basename=%~n2
      set signsis1=%3
      set signsis2=%4
      set signsis3=%5
  ) else (
      set installsigned=false
      set pkgfile=%1
      set basename=%~n1
      set signsis1=%2
  