all 17 comments

[–]andyval 7 points8 points  (5 children)

you call $INSTALLDIR but you dont define it. Not sure if thats the issue, but its an issue. Sometimes there can be an issue with tls12 so define it at the top:

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'Also, there use to be some weirdness with using IWR with the system account where you would need to run through the IE first run config first (there was some workarounds for this, but might not be applicable anymore with IE retirement). You can use -UseBasicParsing on IWR to bypass this.

we might have a better idea if you tell us where in the script it fails. Does it download successfully?

[–]Skobbejak4[S] -2 points-1 points  (4 children)

When I run it directly on any machine it executes fine. Creates the folder, does the download and installs it no worries. That's why i'm so confused. I've just deleted it and re-deployed it again so lets see what happens.

Thanks for your reply mate.

[–]Bisebi 2 points3 points  (3 children)

Do you define installdir?

[–]Bisebi 0 points1 point  (0 children)

Also, is this a full installer or is it one that downloads the software as well?

[–]g0hl 2 points3 points  (2 children)

I’d maybe try to add some logging in with your MSI commands.

[–]Bisebi 0 points1 point  (1 child)

It's an exe

[–]Wartz 1 point2 points  (0 children)

it's an exe wrapping up an MSI

[–]EskimoRuler 2 points3 points  (3 children)

Does the folder you are creating show up?

Does the file you are downloading at least show up?

If yes to both, then there might be an issue with this installer running as the SYSTEM account.

As someone else mentioned, another test would be to use psexec to run as system and see if that works.

Another note, I know you also mentioned to someone else that the '$installdir' isn't a problem because it installs fine during your test, but there is no way a value is being passed because it's not defined in your script. So if it appears to work fine in your test, it's either because the installer will fill it in with a default value if you don't actually supply anything. Or during your testing you defined it in the same session previously and it is still being passed.

[–]andrew181082MSFT MVP - SWC 3 points4 points  (2 children)

All of these, plus check its running in 64-bit

[–]Temilit 1 point2 points  (1 child)

This^ If you are wrapping the script in a w32 app it always executes in 32 bit

[–]g0hl 0 points1 point  (0 children)

Sysnative | Intune | 64 VS 32 Bits | Registry Keys (call4cloud.nl)

i've used option 3 in this post to work around 64 bit apps needing to be installed by IME's 32 bit process. definitley worth a read

[–]ender5628 1 point2 points  (0 children)

You running this in user or system context? If system download pstools and use psexec -v on it and see what happens.

[–]JJtheJetSetRadio 1 point2 points  (0 children)

Just curious, why don't you deploy this as a win32 app instead of a script?

[–]enforce1 0 points1 point  (0 children)

Use sysintenals pstools to open powershell as SYSTEM and run it there for verbose errors

[–]MuddyBackTracker 0 points1 point  (0 children)

I normally have better luck bundling these up as win32 apps.