Create new project from PowerShell - Advanced Installer Community
Dorababu
Posts: 25
Joined: Fri Jun 16, 2017 8:37 am

Create new project from PowerShell

I have the following code where I am trying to create a new project using PowerShell

Code: Select all

$Path = "C:\Program Files (x86)\Caphyon\Advanced Installer 13.1\bin\x86\AdvancedInstaller.com"
$parameters ="\newproject C:\hello.aip"

$pinfo = New-Object System.Diagnostics.ProcessStartInfo
                $pinfo.FileName = "$path"
                $pinfo.RedirectStandardError = $true
                $pinfo.RedirectStandardOutput = $true
                $pinfo.UseShellExecute = $false
                $pinfo.Arguments = "$parameters"
                $pinfo.WindowStyle="hidden"
       
                $p = New-Object System.Diagnostics.Process
                $p.StartInfo = $pinfo
                $p.Start() | Out-Null
                $p.WaitForExit()
                $stdout = $p.StandardOutput.ReadToEnd()
                $stderr = $p.StandardError.ReadToEnd()

                Write-Host $p.ExitCode
But I am not able to create, I am seeing the process is running
Dorababu
Posts: 25
Joined: Fri Jun 16, 2017 8:37 am

Re: Create new project from PowerShell

Resolved my self as follows instead of this $parameters ="\newproject C:\hello.aip" it should be as follows $parameters ="/newproject C:\hello1.aip"
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create new project from PowerShell

Hello,

Thank you for your follow up on this. I can confirm you that our "/newproject" command line parameter should be written with foreslash.

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

Return to “Common Problems”