Azef123
Posts: 3
Joined: Thu Aug 07, 2014 1:11 pm

Powershell return code

Hello,

In custom Actions, Powershell script how return code to stop installation.

I use exit 0, exit 1, exit 2... but nothing

Code: Select all

if ($variable==true){ 
#sucess 
exit ?? 
} 
else { 
#fail 
exit ???
}
Thx
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Powershell return code

Hello,

In order to achieve what you want you can use a script like this:

Code: Select all

if ($variable -eq $true){ 
    #sucess 
     exit 0
} 
else { 
     #fail 
     exit 1
}
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”