Problems Using NET Framework to access Windows Registry - security

i'm using vb.net 2010, .net framework 3.5 and the procedure and the exception I get, are as follows:
I've been reading about manifest, and this and that, but what it seems to me is that i'm still missing something, will anybody kindly give me any suggestions?
Thanks in advance!

You need to be elevated to modify this key. The process that performs these registry modifications needs to run as admin.
Use the requireAdministrator option in the manifest. Or start the process using the runas verb.

Related

Wix Webapplication: How do I add an extension without replacing all existing mappings?

I'm trying to add a .plan extension to our IIS 6.0 website through WiX. I'm using
<iis:WebApplicationExtension CheckPath="no" Script="yes" Executable="[FRAMEWORKROOT]v4.0.30319\aspnet_isapi.dll" Verbs="GET,HEAD,POST,DEBUG" Extension="plan"/>
Although this is replacing all of the existing application extensions, which is not the behaviour that we want. Is there a way to simply add .plan? We would like to avoid using the Wildcard if possible as we're not sure how it will affect the rest of the site. I don't think that APPCMD is available on our 2003 server either.
Any suggestions would be greatly appreciated :)
Unfortunately we didn't find a way to do this cleanly using the iis:WebApplicationExtension in WiX.
We found this post http://blogs.msdn.com/b/david.wang/archive/2004/12/02/273681.aspx that provides a VBScript for adding ScriptMaps. We edited the script to only execute the HandleListOps function (with the relevant params) so that we didn't get any issues with WScript. We then call this from a CustomAction in WiX, with the vbs file added as a Binary file.
We're aware that running vbscript custom actions from within an installer isn't ideal, but luckily we're not distributing the application externally and is only going to be used on an internal website, so the target server environment is reasonably well known.

Installscript - Deleting sites from IIS uninstallation

I am using Installshield 2012 Spring Edition. I have created a setup project. While uninstallation, I need to delete the files from IIS and stop the services automatically. I have tried using some installscript codes. But, I am getting this error:
"error 2762: cannot write script record transaction not started"
Can anyone tell me, is there any other method to do this operation.
Thanks in advance.
Regards,
Naren.
When are you sequencing your custom action? Also what type is your custom action?
If you are trying to execute a deferred custom action then it needs to be sequenced between InstallInitialize and InstallFinalize.
Could you provide a snippet of your install script?

How to add Tridion site in Internet Information Services(IIS) Manager?

I am working SDL TRIDION 2011 SP1 version. Suddenly I am unable to see the Trdion site in Internet Information Services(IIS) Manager. Please tell me the procedure how to get it back again.
Remove Tridion Completely (uninstall), then run the installer again.
You won't loose any data (it's all in the database), and you're likely to get your server up and running way faster than trying to fix by hand.
As #bart suggested, your best option to get the web application back (assuming it really has gone), is to run the repair option with the installer. There are a lot of folder specific settings which would be very hard to recreate manually.

How to add a solution in SharePoint when the UAC is Enabled?

I use stsadm-o addsolution -filename "mySolution" to install a solution, but when the UAC(User Account Control) is enabled, a "Access Denied" exception will be thrown.
I want to know how to add a solution with UAC enabled?
Note: I cannot use runas administrator, for it's cannot be invoked by third assemblies.
Update: I just want to use C# to implement Runas Administrator.
thanks in advance.
I'm going to take a stab in the dark here - I'm guessing that when you say 'third assemblies', you're referring to a third party assembly that is running as part of some application, and you want that application / assembly to be able to install a sharepoint solution. I.e., you're building some type of sharepoint solution management tool.
I could be way off on that, as it's just a guess. But assuming that's true:
If you have UAC enabled, and you want this other assembly / application to be able to call stsadm, then you need to do run this other assembly / application as administrator. Right-click on the exe that kicks it off (or shift-right click), then click 'run as administrator'. That will cause the other application to run in the context of an administrator, so when it calls stsadm it should work.
Run command prompt as Adminstrator
after two days investigating, I have the final result.
In SharePoint 2010, I installed a solution named "NewsGator.Core.wsp", it's a third party solution. When it's installed, some assemblies will be deployed to GAC. When you retract the solution you must notice that if the assemblies are used by w3wp.exe or not(process monitor can do this, you should first run it as administrator), if so your retract job will failed. It occurs in UAC enabled environment and will succeed if you use runas administrator to execute retract method.
So, firstly I doubted it as permission issue, using runas administrator can just make it work, then I came to ask the question above, but finally I found the cause by process monitor, after ended w3wp.exe or iisreset I got my retract job complete with successful.
Hope the above can help you.
Thanks very much for all your help, best regards.

Windows installer security/credential question

Folks,
I've got a strange issue at the moment with a visual studio 2010 built MSI...
When I run the msi, it performs a few tasks, then executes a tool we built - this tool then carries out some more advanced work we couldn't do within a custom task.
The issue here, is then when the msi starts my custom built tool, it doesn't execute it with the same credentials as I start the MSI with (i.e. my administrative login).
Is there a parameter I can pass to an MSI to enforece this? Or perhaps I can pass the credentials to the process when I start it?
My process is started using Process process = Process.Start(procInfo) nothing fancy. I've also noted the ability to pass in a parameterised username/password/domain, but this will vary depending on the user who is installing - can this be extracted from the installer somehow?
Any help (or questions) welcomed.
Dave
EDIT: for clarity... I'm running the MSI under my domain account, and I want my custom process to run under that 'context'. At present, it starts (regardless of whether I start as administrator or not) under the SYSTEM account (rather than mydomain\me). I'm using Windows Server DataCenter edition if that helps...
I should also add, I think this is a policy issue, but I've no idea what to check/where to check...
By default Windows Installer runs custom actions as the current user. If the MSI is elevated, custom actions will run as the elevated user.
Please note that if you are running the MSI as an Administrator, it doesn't mean your custom actions will have full Administrator privileges. On Vista or higher any user can gain Administrator privileges through elevation.
So if your custom actions need Administrator privileges, make sure they use the msidbCustomActionTypeNoImpersonate flag so they run under the local system account.
If this is not the problem and you just need access to the current user data, can you please give me more details?

Resources