How to run DevStudio as an admin from a pinned link? - associations

Win10, DevStudio 2017 Community
I have an app that needs to run with highest privileges, but when I start the debugger the first time after launch of DevStudio, it complains I have to run DevStudio with admin privileges. It offers to restart DevStudio with those privileges, which works, but is an unnecessary and time-consuming step.
I've set DevStudio to run as an admin via Properties/Advanced/Run as Administrator. If I launch DevStudio directly, then load the solution, it runs with the correct privileges. However, if I launch DevStudio by association of the .sln, it launches with incorrect privileges.
How do I get DevStudio to run as an admin from the Startup link or any other link to the solution?
My topic is partially covered here and it's how I got DevStudio to run as an admin if I launch it directly: How to Run Visual Studio as Administrator by default

Related

Window Installer custom action fails for non-Admins

I have a windows setup project along with my project(WPF application) where I am adding a 3rd party USB driver(Silicon Labs USBXpressInstaller.exe) as a Custom Action in the setup project which makes my .MSI file along with the USB driver.
Project Tree: MyProject and SetUp Project
Custom Action for my SetUp Project:
After I build the project and the setup project, it is installing fine if the user is an Admin but gives the error pop-up "There is a problem with this windows installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor"(see below image) every time non-Admin tries to install the MSI. How can I fix this issue?
Any help would be really appreciated. Thank you in advance.
Thanks,
Sudheer
Edits: Below are the properties of my Setup project
Below are the properties of the Custom Action
Edits (08/06/2021): How can I suppress the below window when a non-admin is installing the msi?
Latest Update: I received a call from a client saying that they are not able to install the application at all. The user has DOMAIN ADMINISTRATOR rights for the PC he is trying to install on. For me, it is working now once I enter the Admin password (which I want to suppress). But, for the DOMAIN ADMINISTRATOR, there is no UAC pop-up shown as they are in the ADMINISTRATOR group but does not install as well.

VSTS vNext build "Deploy TestAgent" task never finish when Interactive Process is checked

I am using TFS team service to deploy test agent to on premise Windows 2012 server VM in order to run CodedUI test there. When I uncheck Interactive process, it was deployed fine, but when interactive is checked, the task hangs and never finish. I am using the same credential with Admin privilege for both build agent and test agent (meaning I used same identity in team service UI in the deploy test agent step, and the build agent is configure on another PC with the same identity). The task stuck at "Task 'ConfigureTestAgent' on machine 'xxxxx.xxxxx.com:5986' is taking time. Please Wait". I did a lot of search and did not find solution, please if anybody can help.
depending on the agent version you should install management framework for the right powershell version
also a winrm qucikconfig afterwards can fix it

Permissions needed to WebDeploy from TFS

I am using TFS to Build and Deploy using MSBuild Arguments. I have the following arguments
/P:AllowUntrustedCertificate=True
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=WMSVC
/p:MSDeployServiceUrl=https://myserver.com
/p:DeployIisAppPath="Site1"
/p:UserName=domain\username
/p:Password=password
This works fine when I use my domain account (which is an Admin on the Destination Server), but I want to use a Service Account that has the barebones permissions to get this to work.
I have already setup IIS Manager Permissions for the site, gave Full Control to the folder that the application sits in, and created setAcl, createApp, and contentPath and iisApp Delegation rules for the user.
I have granted read rights to the inetsrv/config folder, and full control to the applicationHost.config file.
I am able to publish my site using the Visual Studio publish process with that user, but am unable to get the deployment to occur using a TFS Build. When I run the build, I get the following error.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4193): Web deployment task failed. (Connected to the remote computer ("myservercom") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
I have looked online and followed all the steps I have seen, but still have the issue. Please let me know if you have any questions.
Thank you in advance
Try changing your MsDeployServiceUrl to:
https://myserver.com:8172/msdeploy.axd
Failing that, take a look at the Microsoft Web Deploy event log (in Applications and Services Logs)

Why would installation method affect .NET service?

I have built a WCF service that is hosted in a Windows Service following this article: http://msdn.microsoft.com/en-us/library/ms733069.aspx. Part of what the code in the service does is join a multicast group and listen for data that is broadcast to the group. Then it processes it. I have found that when I install the service manually using InstallUtil it works fine. To install it manually I do the following:
Build the MyService project in Visual Studio.
Right click on the Visual Studio Command Prompt and choose Run As Administrator
Navigate to the folder that has the MyService.exe file
Run the InstallUtil command as follows: installutil.exe MyService.exe
The service installs in Windows fine and then I start it. Then I run my ASP.NET application which is the client for the service and it runs fine. The service receives and processes the data just fine.
However I am trying to use Advanced Installer to build an MSI or EXE that will install the service and the ASP.NET application all at once so it doesn't have to be done manually. I am able to successfully create the Advanced Installer project that does this and it actually installs both the ASP.NET application and the Windows Service just fine and it starts my Windows Service too. However the really strange thing is that when I run the application I find that my service code can not receive any multicast data. It seems to block on that line of code and I never get any data. Does anyone know why this would happen? I have tried using an EXE and using "Run As Administrator" when I do the Advanced Installer installation. Here is the code from my service.
_groupAddress = IPAddress.Parse(_myIPAddress);
_listener = new UdpClient(_myPort);
_groupEP = new IPEndPoint(_groupAddress, _myPort);
_listener.JoinMulticastGroup(_groupAddress);
byte[] _bytes = _listener.Receive(ref _groupEP);
It seems to block on that last line of code and it never receives any data. This only happens when I install using Advanced Installer. When I install manually it works fine.
A service is configured to run under the identity of a user. Is this different when you install with the different methods?
Do you use the same port number in both cases, if not it could be the firewall.
99% sure that you have checked it, but check that the service is running after it is installed using advanced installer.
Check the event log for problems with the service.
It may be that your Windows Service is not running with sufficient credentials to perform this action. To test this, I'd recommend trying to change the user account being used for the service to see if that makes any difference.
To do this, go to the services applet (start, run, type services.msc). Find your service, right-click, properties, "Log On" tab, choose "This Account" and select an administrator user account that the service can run under.
I initially thought as the guys said this was a problem with the user credentials. But since you said in both cases the service is installed under the LocalSystem the problem seems to be elsewhere.
I recommend you first check the system "Events Viewer" for any messages regarding your message failing to start, maybe there you can find more information about the failure case.
If you can't find more detailed there I suggest a little bit of reverse engineering, to see what InstallUtil does and Advanced Installer doesn't, or the other way around. Advanced Installer comes along with the Repackager tool. You can use this tool to capture the system changes performed when running "InstallUtil" by providing a dummy executable to the Repackager when it is asking for the setup package, for example Notepad.
When the Repackager launches Notepad, leave it open and run your install command for the service, after the service finished installing, close Notepad and leave the repackager do its job. Then analyze the new project that it generates to see what resources has captured, like files, registry, services, etc...
You can also capture the install package create by Advanced Installer to see if the services installation from it creates less or more registration info for your service.

CC.Net Access Denied Error

I have CruiseControl.Net setup as my continuous integration environment. I've been working on adding a Visual Studio 2008 Web Deployment Project to my solution but I'm getting a weird "access denied" error and I can't figure out why.
I have CC.Net running under its own account on my server which is a member of the administrators group, so the CC.Net service should have access to everything it needs. The problem is when I trigger a build from the web interface the build fails with the error:
C:\Program Files
(x86)\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5):
error : Access is denied.
The particular task on that line is the "CreateVirtualDirectory" task to create an IIS virtual directory for my asp.net application.
What's weird is if I open a command prompt on my build server running as the exact same user account the CruiseControl service is running as and run my build script everything builds successfully - including the creation of the IIS virtual directory. It's only when a build is initiated through the web interface that it fails.
I don't understand what the difference is between the two since presumably they are both running as the same user with the same privileges.
Suggestions?
Is it possible that the virtual folder it is trying to create already exists? Another thought - when you run from a command line, it is possible you have different environment variables or drive mappings that CC.Net wouldn't have?

Resources