How to Set User-Developed Web Browser as the Default Browser? - browser

I am developing a web browser in c#.. i need to give option to the user for my web browser as set to Default browser??? how is it possible

On Windows check out this Registry key:
HKEY_CLASSES_ROOT\HTTP\shell\open\command
There's also HTTPS too. You'd ideally want to check this is set to your application and if not then ask to set it.

You need to set the registry key HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\(Default). Or HKEY_LOCAL_MACHINE if you want it to affect the entire machine (in which case you may need to set the HKCU version too or it will override).

Related

Run shortcut as administrator

In InstallShield 2015 Premier , how to set a shortcut created for an EXE to have ability of Run As Administrator. I have searched every corner in InstallShield, but not find option I need
Thanks
There is no front-end option. However, you can create a registry entry in your project to set up the following:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\yourapp.EXE"="~ RUNASADMIN"
It may or may not accept [INSTALLDIR] variable, if it does not, you can create registry entry using InstallScript.
Alternatively, you can embed application manifest into your application itself, in which case you won't need to worry about setting admin rights in IS.

IIS - AddDataProtection PersistKeysToFileSystem not creating

I've developing an asp.net core application to tun on a web far, and I'm using "AddDataProtection" to protect for key encryption at rest like, the documentation recommends, but when I deploy my application and run directly from IIS with AppPool identity, the key is never created and I get errors on the DpapiNG windows logs.
My code is the following:
services.AddDataProtection(opt => opt.ApplicationDiscriminator = ApplicationConfig.dataProtectionApplicationDiscriminator)
.PersistKeysToFileSystem(new DirectoryInfo(encKeyPath))
.ProtectKeysWithDpapiNG(string.Format("CERTIFICATE=HashId:{0}", ApplicationConfig.dataProtectionCertThumbprint),
flags: DpapiNGProtectionDescriptorFlags.None);
Debugging from visual studio, everything runs fine, but I'm running VS under administrator rights, so permission is not an issue here.
I've tried adding permissions to the AppPool App user to the private key it self directly from MMC, but it did not worked, and even gave permission on the full path to the location were the keys should be created like stated here https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview (check first comment) but also it did not worked.
I was only able to make it work by setting the AppPool to run with the identity of an Administrator, but clearly this is a no go, I just wanted to make sure this was a permission issue somewhere.
Is anybody facing the same issue that is able to help?
Regards,
André
Most likely your issue is you are trying to store your keys somewhere in a folder path that you are cobbling together (or even by using the default path that AddDataProtection provides) that uses an environment path such as %LOCALAPPDATA%. Example: "%LOCALAPPDATA%\ASP.NET\DataProtection-Keys".
Usually, by default IIS DOES NOT set up your app pool accounts with environment path variables such as %LOCALAPPDATA%. The value ends up being blank and your app then tries to write keys to the wrong folder (such as \ASP.NET\DataProtection-Keys instead of %LOCALAPPDATA%\ASP.NET\DataProtection-Keys).
Fix: Within %WINDIR%\System32\inetsrv\config\applicationHost.config set setProfileEnvironment=true. I think you have to restart IIS as well.

force inno setup to store data in HKCU with PrivilegesRequired=lower

When Inno Setup configured with PrivilegesRequired=admin, it stores uninstall registry key in HKEY_LOCAL_MACHINE.
How can i force to store uninstall registry key in HKEY_CURRENT_USER?
As your title said, you need to use PrivilegesRequired=lowest. Anything other than that, and the "local user" may not be what you expect.
If the setup needs admin permissions to remove the old setup, you can use ShellExec, making sure that the application you're calling as the admin manifest, or you pass the "runas" verb.

Config IIS handler mapping using C#

I am trying to deploy a PHP application to azure web cgi role. I set my web.config and web.roleconfig correctly, I believe. Since when I remote to the machine, I set the fast cgi handler in IIS manually to the same value. It works. However, it doesn't work after the package is deployed, even if the value is the same! I have to manually reset it to the same value! Sounds weird?
So I am thinking to write a piece of code in role start event to reset the mapping. Does anybody knows how to do it in C#?
Thanks
KAO!
Setting up the handler mapping has two phases:
1. setup web.config
2. create application
I only did first one. By clicking the OK on the popup window on UI will set the second. So if I want to deploy to Azure on a side website (which mean the website is not linked with the web role), I have to do the second setup myself, by either manually or runing a command line: %windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='XXXX\php-cgi.exe']

How do you configure IIS5 advanced settings from command line?

I am trying to automate some of the build process for my asp.net apps by creating the virtual directories it needs and setting all their settings in a batch file. So far I have been able to figure out how to create virtual directories, but how to do you configure them beyond that?
For example I need to be able to set them as an application, set the default document, change framework version, turn on integrated authentication, etc. Does anyone know of any scripts that can do all this without a third party utility? Does the adsutil.vbs admin script do any of this?
Thanks, that documentation helped a lot. I wanted to post the script I ended up with. It generates the virtual directory, sets access settings, makes it an application, sets its isoloation level, sets default document, sets authentication, and even sets the framework version. Its everything I have been looking for. It does it all with the admin scripts that come with IIS5.
mkwebdir -c LocalHost -w "Default Web Site" -v "myvirdirectory","C:\Website Path\..."
adsutil APPCREATEINPROC w3svc/1/root/myvirdirectory
adsutil SET w3svc/1/root/myvirdirectory/AppFriendlyName myvirdirectory
adsutil SET w3svc/1/root/myvirdirectory/AccessScript True
adsutil SET w3svc/1/root/myvirdirectory/AppIsolated 2
adsutil SET w3svc/1/root/myvirdirectory/AuthAnonymous True
adsutil SET w3svc/1/root/myvirdirectory/AuthNTLM False
adsutil SET w3svc/1/root/myvirdirectory/AuthBasic False
adsutil SET w3svc/1/root/myvirdirectory/DefaultDoc index.aspx
adsutil SET w3svc/1/root/myvirdirectory/EnableDefaultDoc True
%windir%\microsoft.net\framework\v2.0.50727\aspnet_regiis -s w3svc/1/root/myvirdirectory
Look at http://msdn.microsoft.com/en-us/library/ms524830%28VS.90%29.aspx and http://msdn.microsoft.com/en-us/library/ms524579%28VS.90%29.aspx.

Resources