You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd suggest adding the -NoProfile parameter to ensure any PowerShell user profile is not executed. At best it slows the installer down by unnecessarily loading any profile settings, but more seriously it can interfere with the installation process and result in erroneous error messages.
My own profile is an example of this: in some scenarios it compiles some C# code via Add-Type. It turns out that when generating the parameters to pass to the C# compiler (csc.exe), PowerShell adds a relative reference to System.dll (to facilitate the automatic using System; statement added to the provided C# code). The PowerShell process is launched in the above created temporary directory and NSIS drops a System.dll there, which gets picked up by the compiler instead of the correct .NET CLR assembly. That results in a bunch of error spew in the installer output due to the failed compilation.
In my case it's harmless but misleading, though more serious interference with the installer is possible. Admittedly it's an edge case, but I can't see any benefit from executing user profiles during install, and -NoProfile should make the installer more deterministic.
The text was updated successfully, but these errors were encountered:
We'll definitely do that! Npcap is currently supporting Windows 7, which means we have to ensure our scripts and invocation can be used with Powershell 2.0. Do you know if the -NoProfile switch is supported in that version?
Fixed in Npcap 1.55 release. We also changed the npcapwatchdog task creation from a signed script to a one-line command to avoid the overhead of digital signature validation, which should speed up the install process as well.
During Npcap installation a PowerShell process is launched to run the
npcapwatchdog.ps1
script with the following parameters:I'd suggest adding the
-NoProfile
parameter to ensure any PowerShell user profile is not executed. At best it slows the installer down by unnecessarily loading any profile settings, but more seriously it can interfere with the installation process and result in erroneous error messages.My own profile is an example of this: in some scenarios it compiles some C# code via
Add-Type
. It turns out that when generating the parameters to pass to the C# compiler (csc.exe
), PowerShell adds a relative reference toSystem.dll
(to facilitate the automaticusing System;
statement added to the provided C# code). The PowerShell process is launched in the above created temporary directory and NSIS drops aSystem.dll
there, which gets picked up by the compiler instead of the correct .NET CLR assembly. That results in a bunch of error spew in the installer output due to the failed compilation.In my case it's harmless but misleading, though more serious interference with the installer is possible. Admittedly it's an edge case, but I can't see any benefit from executing user profiles during install, and
-NoProfile
should make the installer more deterministic.The text was updated successfully, but these errors were encountered: