title: Advance installer create registry using command line
body: <p>I have gone through the following link <a href="http://www.advancedinstaller.com/user-guide/new-reg.html" rel="nofollow noreferrer">http://www.advancedinstaller.com/user-guide/new-reg.html</a> to create registries using command line</p>
  
  <pre><code>$InstallerName = "Installer1.2.10"
  $registryParams ="/edit $aippath /NewReg -RegKey HKLM\Software\MYApplication\Database\*"
  $SourceDir = "D:\AdvanceInstaller"
  $AdvanceInstallerPath = Get-ChildItem "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" |  ForEach-Object {Get-ItemProperty $_.PSPath} | Where-Object {$_.DisplayName -match "Advanced Installer"}
  $InstallerPath= "$($AdvanceInstallerPath.InstallLocation)bin\x86\AdvancedInstaller.com"
  $aippath = "$SourceDir\$($InstallerName).aip"
  $ProductName = "MYApplication"
  
  $DeleteReg = "/edit $aippath /DelReg -RegKey HKLM\SOFTWARE\WOW6432Node\MyApplication"
  $ProductParams = "/edit $aippath /SetProperty ProductName=$ProductName"
  $repository = "/edit $aippath /SetAppdir -buildname DefaultBuild -path C:\MyApplication"
  $newParameters = "/newproject $aippath -type enterprise"
  $buildParams = "/build $aippath" 
  
  Start-Process -FilePath $InstallerPath -ArgumentList $newParameters -Wait -WindowStyle Hidden -ErrorAction Stop
  Start-Process -FilePath $InstallerPath -ArgumentList $ProductParams -Wait -WindowStyle Hidden -ErrorAction Stop
  Start-Process -FilePath $InstallerPath -ArgumentList $repository -Wait -WindowStyle Hidden -ErrorAction Stop
  $pinfo = New-Object System.Diagnostics.ProcessStartInfo
  $pinfo.FileName = "$InstallerPath"
  $pinfo.RedirectStandardError = $true
  $pinfo.RedirectStandardOutput = $true
  $pinfo.UseShellExecute = $false
  $pinfo.Arguments = "$DeleteReg"
  
  $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 $stdout
  Write-Host $stderr
  Start-Process -FilePath $InstallerPath -ArgumentList $buildParams -Wait -WindowStyle Hidden -ErrorAction Stop
  Start-Process -FilePath $InstallerPath -ArgumentList $registryParams -Wait -WindowStyle Hidden -ErrorAction Stop
  </code></pre>
  
  <p>But I am unable to see the desired registry created after installation. What I need is as per the following after installing the software</p>
  
  <blockquote>
    <p>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MySoftware]
    "Path"="C:\MySoftware"</p>
    
    <p>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MySoftware\Database]
    "connectionstring"="server=.;initial db=master"</p>
  </blockquote>
  
  <p>Also when installing the <code>msi</code> the default registry is getting created as <code>My Company\Project</code> which I don't want</p>