0
我已經通過下面的鏈接http://www.advancedinstaller.com/user-guide/new-reg.html創建使用命令行提前安裝程序創建註冊表使用命令行
$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
登記但我無法看到安裝後創建了所需的註冊表。我需要的是按下面的安裝軟件
[HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ MySoftware] 「路徑」 後= 「C:\ MySoftware」
[HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ MySoftware \數據庫] 「的ConnectionString」 =「服務器=;初始數據庫高手」
而且我不想
安裝默認的註冊表是越來越創建爲My Company\Project
的
msi
時