Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xPackage arguments missing a space #195

Closed
tehsuk opened this issue Aug 12, 2016 · 8 comments
Closed

xPackage arguments missing a space #195

tehsuk opened this issue Aug 12, 2016 · 8 comments
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@tehsuk
Copy link

tehsuk commented Aug 12, 2016

xPackage is missing a space before the string in the Arguments parameter.

Example DSC that used to work:

xPackage InstallAccessDataBaseEngine_x64
{
    Name = 'Microsoft Access database engine 2010 (English)'
    Ensure = 'Present'
    Path = 'C:\Install\AceRedist.msi'
    ProductId = '90140000-00D1-0409-1000-0000000FF1CE'
    Arguments = '/quiet /norestart'
    ReturnCode = @(
        '0',
        '3010'
    )
}

Logged:

[[xPackage]InstallAccessDataBaseEngine_x64] Starting
C:\Windows\system32\msiexec.exe with /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart
VERBOSE: [97561A4CD997]:
[[xPackage]InstallAccessDataBaseEngine_x64] Starting process C:\Windows\system32\msiexec.exe with arguments /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart

process info showing the missing space

PS C:> gwmi win32_process -filter "name = 'msiexec.exe'" | Select-Object CommandLine

CommandLine

"C:\Windows\system32\msiexec.exe" /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart

@tehsuk
Copy link
Author

tehsuk commented Aug 12, 2016

Also wanted to add that I'm working around this for now by adding a leading space in my argument list.

@PlagueHO
Copy link
Member

@tehsuk - thanks for raising the issue! I'm working on this resource at the moment so I'll include a fix for this too.

@Zuldan
Copy link

Zuldan commented Aug 15, 2016

@PlagueHO, just wondering if you had some time to resolve the issue?

@kwirkykat kwirkykat added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Aug 15, 2016
@PlagueHO
Copy link
Member

Hi @Zuldan, I just needed to submit a PR to fix the pssa errors on the resource. This would then allow me to begin addressing the other issues on it. I'll get going on this after work tonight! Won't take long

@Zuldan
Copy link

Zuldan commented Aug 16, 2016

@PlagueHO, thank you so much! I've got a dirty hack to get it working for the time being. Looking forward to the full fix. Maybe there should be some sort of Pester test to check parameters are formatted correctly?

This is a bit cheeky of me...but I'm wondering if you would consider adding a feature to xDisk (dsccommunity/StorageDsc#47). I'm wanting to use it in conjunction with ciSCSI and configuring SQL Servers.

@tehsuk
Copy link
Author

tehsuk commented Aug 16, 2016

@Zuldan: I found a relatively 'clean' hack is to put a leading space in the argument list.

eg: replace:
Arguments = '/quiet /norestart'
with
Arguments = ' /quiet /norestart'

This should work even after the bug is fixed.

@iainbrighton
Copy link
Contributor

@Zuldan @tehsuk I'm working on this issue now and, looking through the code of the current (5.0.0.0) release, the /quiet parameter is automatically passed for MSI packages. You can see this here: https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1#L1282.

The /NoRestart argument is missing and I'll add this in. This should be in by default as we need to restrict the ability to reboot to the LCM.

@Zuldan
Copy link

Zuldan commented Nov 22, 2016

@iainbrighton thanks for the update. Every time a new version xPSDesiredStateConfiguration is released I have to change...

$startInfo.Arguments += " /quiet"

to...

$startInfo.Arguments += " /quiet "

so that xPackage doesn't get stuck. Really annoying. Probably my fault for not learning how to do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

5 participants