Is there a way to launch msbuild so that it calls devenv.exe as admin? We need this because it registers COM assemblies as part of the build.
thanks - dave
The only way is to launch MSBuild.exe as administrator (such as running msbuild command at an elevated command prompt), then all processes initialized by it such as devenv.exe are running under administrator context.
Related
I am using a custom installer in Wix 3.10. In my custom bootstrapper contains three exe packages.
When i am accept the UAC it shows two exe in the task manager. Why it shows two exe in taskmanager?
One process is the unelevated process that is showing the UI. The other one is the elevated process running your MSIs and other packages. Doing it this way means you only ever get one UAC popup during your install because all packages are run by the elevated process and inherit the elevated status when they run so they never need to do a UAC prompt.
Is it possible to run the exe built using WIX burn bootstrap to run in silent mode? I need to do this in order to skip the UAC prompt. Are there any better ways to skip the UAC prompt using the WIX project itself? Without making any changes to the registry keys manually.
Burn supports silent installations. Use the /quiet switch to run installation without any user interface. This will not show the UAC prompt.
AppInstaller.exe /install /quiet
If your installation requires elevated rights to install properly, run it from another already elevated process - either command line, or a management software.
I want to run MSBuild on a users PC as part of a WinForms ClickOnce deployment. That is after the application is downloaded and run (via clickonce) the application needs to kick off an MsBuild to handle database updates (using MigratorDotNet).
Q - How can my application robustly kick off MsBuild? i.e. how can it be sure what path it is installed, what if it is not installed, should I be including the MSBuild.exe in the clickonce package so that I know it is there for sure myself?
You can look at the values for MSBuildToolsPath under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
But with ClickOnce I don't think you will be able to execute MSBuild scripts.
I don't think you are allowed to redistribute MSBuild. Since MSBuild is distributed with the .NET Framework you can just check to see if v2+ is installed. If not then you can prompt them to install it.
I am currently still fiddling with our msbuild & deployment script and one of the steps is to register a (legacy) com component on the machine the code is deployed to. Is there any 'elegant' way to accomplish this or would I have to call the regsvr32.exe via wmi on the remote machine?
You can use PsExec (from formerly SysInternals - but now part of Microsoft) to execute shell commands on remote machines.
Just use a standard MSBuild Exec task that wraps PsExec.
You could use PowerShell v2 remoting via an MSBuild PowerShell task
As part of your build you could create an MSI that installs your COM component (e.g. using WiX -- Votive has msbuild support).
Then you'd run the installation on the remote machine by invoking the Win32_Product.Install method.
You could manually perform the COM component registration by using the StdRegProv WMI class to
write to the registry on the remote machine (i.e. create the HKLM\CLSID{guid} entries, etc)
I'm running MSBuild from a NAnt script. When it tries to register one of my assemblies for com interop, the script stops like it's stuck.
If I run regasm.exe on the assembly, it succeeds. Even if I run MSBuild itself from the command-line with the exact same parameters, it builds successfully.
What is the problem with using the NAnt script to run MSBuild to register the assembly? Could it be permissions?