更新Windowsレジストリに適切にアクセスしてWiXでPowerShellを起動するには?
興味深い私はスクリプトを実行するには、32ビットPowerShellを実行する場合、それは私に同じエラーを与えます。 32ビットのpowershellには64ビットレジストリツリーへのアクセス権がないようですか?私はWixQuietExec64
を使ってみましたが、同じエラーが発生しました。私もインストーラが64ビットバージョンを起動するようにpowershell(C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
)の完全なパスを提供しようとしましたが、同じエラーが発生しました...これは32ビットのMSIインストーラ自体によって引き起こされるようですか?
MSI (s) (4C:C0) [14:25:49:955]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
オリジナルポスト
私は、次のしているtest.ps1
スクリプト:
$exchangeroot = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\"
$allexchanges = Get-ChildItem -Path Registry::$exchangeroot -Name | Where-Object { $_ -match "^V.." }
$sorted = $allexchanges | Sort-Object -descending
If ($sorted.Count -gt 1) { $latest = $sorted[0] } Else { $latest = $sorted }
$setup = $exchangeroot + $latest + "\Setup"
$properties = Get-ItemProperty -Path Registry::$setup
$properties
は、次のような出力が得られますので、
PS C:\Program Files (x86)\TrustValidator Exchange Server Plugin> .\test.ps1
Required machine-level settings. : 1
Services : C:\Program Files\Microsoft\Exchange Server\V15
NewestBuild : 10845
CurrentBuild : 710737954
Information Store Service : 1
Messaging and Collaboration Event Logging : 1
MsiInstallPath : C:\Program Files\Microsoft\Exchange Server\V15\
...
できます。今、私たちは、エラーメッセージを観察した場合、それはHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\
までツリーまでのアクセスを持っているかのように、それがあるため、ある
WixQuietExec: Get-ItemProperty : Cannot find path
WixQuietExec: 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\Setup' because it
WixQuietExec: does not exist.
WixQuietExec: At C:\Program Files (x86)\TrustValidator Exchange Server Plugin\test.ps1:10
WixQuietExec: char:16
WixQuietExec: + $properties = Get-ItemProperty -Path Registry::$setup
WixQuietExec: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WixQuietExec: + CategoryInfo : ObjectNotFound: (HKEY_LOCAL_MACH...erver\v15\Set
WixQuietExec: up:String) , ItemNotFoundException
WixQuietExec: + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetIt
WixQuietExec: emPropertyCommand
:今のWiXインストーラからPowerShellを起動し、スクリプトを実行し、それは同じ結果を生成しません。私のスクリプトはすべてのバージョンを検索して一覧表示するので、v15
にはその時点までアクセス可能でなければなりませんが、ItemProperty
を得るために深くしようとするとできません。
これは、WiXインストーラからPowerShellを起動したときに私が何か不足していると思うかもしれません。
これは私のWXSファイルには何がある:
以下<SetProperty Id="InstallPlugin"
Before ="InstallPlugin"
Sequence="execute"
Value =""powershell.exe" -Command "cd '[INSTALLFOLDER]'; & '[#TestPS1]' ; exit $$($Error.Count)"" />
<CustomAction Id="InstallPlugin" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />
は、私はすでに試したかダブルチェックした項目のリストです:
- 私は
-NoProfile
のさまざまな組み合わせを試してみました、-ExecutionPolicy ByPass
,-Version 2.0
であり、依然として良好ではない。 - 私はすでに私が
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
を設定しようとしましたAdminImage="yes"
Execute="deferred"
として及び
Impersonate="no"
私はすでに
CustomAction
を実行している
InstallPrivileges="elevated"