No subject


Fri Dec 17 08:58:42 CST 2010


--- snip ---
...
[ProductInstall.GlobalRegistryChanges.Install]

AddReg=PowerShell.Add.Reg
DelReg=PowerShell.Del.Reg

...
[PowerShell.Add.Reg]
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"ApplicationBase",0x00000000,%SystemRoot%\system32\WindowsPowerShell\v1.0
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"ConsoleHostAssemblyName",0x00000000,"Microsoft.PowerShell.ConsoleHost,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,ProcessorArchitecture=msil"
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"ConsoleHostModuleName",0x00000000,"""%SystemRoot%\system32\WindowsPowerShell\v1.0\Microsoft.PowerShell.ConsoleHost.dll"""
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"PowerShellVersion",0x00000000,"2.0"
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"PSCompatibleVersion",0x00000000,"1.0,2.0"
HKLM,SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine,"RuntimeVersion",0x00000000,"v2.0.50727"
HKLM,SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell,"Path",0x00000000,%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

--- snip ---

There are also %token% strings which are _not_ to be replaced, hence the double
% quoting:

--- snip ---
HKLM, SYSTEM\CurrentControlSet\Services\WinRM\Parameters, ServiceDll,
0x00020000, "%%SystemRoot%%\system32\WsmSvc.dll"
--- snip ---

MSDN says about the "INF AddReg Directive":
http://msdn.microsoft.com/en-us/library/ff546320.aspx

--- snip ---
[add-registry-section]
reg-root, [subkey],[value-entry-name],[flags],[value]

...
value

...
    The expression of such a value depends on the registry type specified for
the flag, as follows:

        * A registry string-type value can be expressed either as a "quoted
string" or as a %strkey% token defined in a Strings section of the INF file.
Such an INF-specified value does not have to include a NULL terminator at the
end of each string.
...
--- snip ---

There is a "dynamic strings" directive present in .inf file:

--- snip ---
[DynamicStrings]
SystemRoot=InstallPathEnvVar,SystemRoot 
--- snip ---

This part is processed by installer, updspapi.UpdSpSetDynamicStringA gets
called:

--- snip ---
0023:Call setupapi.SetupFindFirstLineA(00144c68,01025d10
"DynamicStrings",00000000,0033bb94) ret=010758be
0023:Call ntdll.RtlCreateUnicodeStringFromAsciiz(0033baa8,01025d10
"DynamicStrings") ret=688f6bbf
0023:Ret  ntdll.RtlCreateUnicodeStringFromAsciiz() retval=00000001 ret=688f6bbf
0023:trace:setupapi:SetupFindFirstLineW (0x144c68,L"DynamicStrings",(null)):
returning 63/0
..
0023:Call msvcrt._vsnprintf(0033b34b,000007f7,01025830 "ProcessDynamicStrings: 
InstallPathEnvVar for %s returned %s",0033bb80) ret=010706ea 
...
0023:Call updspapi.UpdSpSetDynamicStringA(00144c68,010f4940
"SystemRoot",001b7108 "C:\\windows") ret=01075d51
0023:fixme:updspapi:UpdSpSetDynamicStringA 0x144c68 "SystemRoot" "C:\\windows"
0023:Ret  updspapi.UpdSpSetDynamicStringA() retval=00000001 ret=01075d51 
...
0023:Call msvcrt._vsnprintf(0033b34b,000007f7,01025754 "ProcessDynamicStrings: 
all %%%s%% replaced with %s.",0033bb80) ret=010706ea 
--- snip ---

Setupapi installer log:

--- snip ---
2.734: ProcessDynamicStrings:  InstallPathEnvVar for SystemRoot returned
C:\windows
2.734: ProcessDynamicStrings:  all %SystemRoot% replaced with C:\windows. 
--- snip ---

At later stage, when the registry section is processed:

--- snip ---
0023:trace:setupapi:SetupFindNextMatchLineW
(0x144c68,L"ProductInstall.GlobalRegistryChanges.Install",L"AddReg"): returning
2
0023:trace:setupapi:SetupGetStringFieldW context 0x144c68/0x144c68/10/2 index 1
returning L"PowerShell.Add.Reg"
0023:trace:setupapi:SetupFindFirstLineW
(0x144c68,L"PowerShell.Add.Reg",(null)): returning 48/0
0023:trace:setupapi:SetupGetStringFieldW context 0x144c68/0x144c68/48/0 index 1
returning L"HKLM"
0023:trace:setupapi:SetupGetStringFieldW context 0x144c68/0x144c68/48/0 index 2
returning L"SOFTWARE\\Microsoft\\PowerShell\\1\\PowerShellEngine" 
...
0023:trace:setupapi:SetupGetStringFieldA context 0x144c68/0x144c68/48/0 index 4
returning "0x00000000"
0023:Call advapi32.RegCreateKeyExW(80000002,0033935c
L"SOFTWARE\\Microsoft\\PowerShell\\1\\PowerShellEngine",00000000,00000000,00000000,02000000,00000000,0033b37c,00000000)
ret=688ec641
0023:Ret  advapi32.RegCreateKeyExW() retval=00000000 ret=688ec641
0023:trace:setupapi:registry_callback key 0x80000002
L"SOFTWARE\\Microsoft\\PowerShell\\1\\PowerShellEngine"
0023:trace:setupapi:SetupGetStringFieldW context 0x144c68/0x144c68/48/0 index 3
returning L"ApplicationBase" 
...
0023:trace:setupapi:SetupGetStringFieldW context 0x144c68/0x144c68/48/0 index 5
returning L"%SystemRoot%\\system32\\WindowsPowerShell\\v1.0"
0023:trace:setupapi:do_reg_operation setting value L"ApplicationBase" to
L"%SystemRoot%\\system32\\WindowsPowerShell\\v1.0"
0023:Call advapi32.RegSetValueExW(0000006c,0033935c
L"ApplicationBase",00000000,00000001,0075d100,0000005a) ret=688ec5be
0023:Ret  advapi32.RegSetValueExW() retval=00000000 ret=688ec5be
...
0023:Call advapi32.RegCloseKey(0000006c) ret=688ec6ce
0023:Ret  advapi32.RegCloseKey() retval=00000000 ret=688ec6ce 

--- snip ---

The string field containing %SystemRoot% token never got the replacement value.
Updspapi.dll UpdSpSetDynamicStringA() is a stub and does not have any
connection to setupapi, maybe this is the problem.
Updspapi seems like an internal/private version of Microsofts setupapi library,
distributed with installers/SP installers - not to be installed into OS.
Unfortunately setting updspapi to "native", skipping Wine's builtin stub
crashes the installer.

BTW ... the PowerShell console/command line stuff really integrates nicely now
that Wine has proper console support (wineconsole no longer needed).

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list