Here’s my (first) DSC script:
param(
[string[]]
$ComputerName = 'localhost'
)
configuration InstallNodeJS
{
param(
[string[]]
# The name of the computer(s) to install node JS.
$ComputerName
)
node $ComputerName
{
Package installNodeJS
{
Name = 'NodeJS';
Path = 'C:\node-v0.10.29-x64.msi';
Ensure = 'Present';
ProductId = '';
Arguments = '/log C:\nodeInstallLog.txt';
}
}
}
InstallNodeJS -ComputerName $ComputerName
When I run
Start-DscConfiguration, the node installation fails with error code 1603:
>> Start-DscConfiguration .\InstallNodeJS -Wait -Verbose -Credential ********
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer ********with user sid ********
VERBOSE: [********]: LCM: [ Start Set ]
VERBOSE: [********]: LCM: [ Start Resource ] [[Package]installNodeJS]
VERBOSE: [********]: LCM: [ Start Test ] [[Package]installNodeJS]
VERBOSE: [********]: [[Package]installNodeJS] The package NodeJS is not installed
VERBOSE: [********]: LCM: [ End Test ] [[Package]installNodeJS] in 0.3280 seconds.
VERBOSE: [********]: LCM: [ Start Set ] [[Package]installNodeJS]
VERBOSE: [********]: [[Package]installNodeJS] The package NodeJS is not installed
VERBOSE: [********]: [[Package]installNodeJS] Package configuration starting
VERBOSE: [********]: LCM: [ End Set ] [[Package]installNodeJS] in 10.5950 seconds.
PowerShell provider MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 1603 was not expected. Configuration is likely not correct
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : ********
VERBOSE: [********]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : ********
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 11.465 seconds
When I inspect the installation log, I’m seeing this error:
WixCreateInternetShortcuts: Creating IUniformResourceLocatorW shortcut 'C:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js website.url' target 'http://nodejs.org' WixCreateInternetShortcuts: Error 0x80070003: failed to save shortcut 'C:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js website.url' WixCreateInternetShortcuts: Error 0x80070003: failed to create Internet shortcut CustomAction WixCreateInternetShortcuts returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
So it looks like the installer doesn’t have permission to write some shortcuts.
The installer runs fine when I run it in quiet mode via a remoting prompt:
> msiexec /i C:\node-v0.10.29-x64.msi /quiet /log C:\nodeInstallLog.txt
When I look at the installation log, I see the shortcut was put under my user directory:
WixCreateInternetShortcuts: Creating IUniformResourceLocatorW shortcut 'C:\Users\********\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js website.url' target 'http://nodejs.org' WixCreateInternetShortcuts: Creating IUniformResourceLocatorW shortcut 'C:\Users\********\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Node.js\Node.js documentation.url' target 'http://nodejs.org/dist/v0.10.29/docs/api/'
Is this a problem with the package resource? The Node installer? My system’s permissions?
I’m getting this behavior on Windows 7 and Windows 2012 R2.