Configuring an installer to enable/disable startup on Windows start - windows

I am trying to install an application for Windows 8.1 onwards so that it can be enabled and disabled to startup on Windows start both from the TaskManager and from Windows > Settings > Apps. The registry is being created like this:
<RegistryValue Id="myProgram.exe"
Root="HKLM"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
This successfully adds the program to the startup applications list, and it can be disabled / enabled from the Task Manager but cannot be controlled from Windows > Settings > Apps. The application shows up in the Windows Settings list, but you can tell toggling the enable / disable doesn't change anything by going into the registry and seeing that the value at HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My Program does not change. Why is Windows Settings not able to control this startup application?
Also, if we want to pre-enter a value for enabling / disabling startup at HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My Program, which binary value would we use for each option?

According to this website https://winaero.com/blog/how-to-add-or-remove-startup-apps-in-windows-10/ the "Modern" startup apps system setting only applies to Run key in HKCU.
I've not tested this article. You might want to use profiling tools such as registry snapshot/diff and/or processexplorer to verify what this new settings screen is doing.

HKCU: I am not sure, and I can't test right now. Trying some hints. As Chris indicates: why do you write to HKLM? Change it to HKCU and see if that works:
<RegistryValue Id="myProgram.exe"
Root="HKCU"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
Autoruns: There is a tool from SysInternals that is good to use when checking auto-run issues: https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns. And a direct run from source link. Using this tool it seems that when disabling an item in the list, they are moved to a sub-key called AutorunsDisabled:

Related

How to Disable Internet Explorer Enterprise mode in IE

I want to disable the site , that is loading in Enterprise mode .
I have checked the Register key settings and Group policy object ,
Under Register:
{HKLM|HKCU}\Software\Policies\Microsoft\Internet Explorer} the Main is not exists
and under GPO the Enterprise mode option is not available.
In both the place it is not configured. Any suggestions?.
Thank you in advance.
It's possible, although unlikely, that the EnterpriseMode registry key is in {HKLM|HKCU}\Software\Microsoft\Internet Explorer (notice it's not in the Policy node).
Another possibility is that you have locally set the site to use Enterprise Mode. This is done by going to "Tools" -> "Enterprise Mode".
You can do this with the help of the Registry editor.
Open a regedit.exe from "Run" and go to HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main\EnterpriseMode.
You will find keys against the Enterprise mode in the right hand side panel, such as DEFAULT, ENABLE and SITELIST.
You will need to DELETE the keys called ENABLE and SITELIST.
Run your application again on IE and test. You must have the result.
NOTE: This solution could be temporary as the registry adds those keys back after a system restart!

IIS8 Win8 and runAllManagedModulesForAllRequests="true"

I am attempting to run an application in IIS8 that has the following in the config:
<modules runAllManagedModulesForAllRequests="true" />
IIS8 is giving me an error that says...
This configuration section cannot be used at this path. This happens
when the section is locked at a parent level. Locking is either by
default (overrideModeDefault="Deny"), or set explicitly by a location
tag with overrideMode="Deny" or the legacy allowOverride="false".
I'm guessing by the error and a quick SO search that there is some higher level security setting that's preventing that line from being allowed. Any ideas?
I've solved the same problem by installing the window features "Internet Information Service/World Wide Web Service/Application Development/ASP.NET x.x" in the Control Panel of Windows8. If you want to setting on Windows Server 2012, the following link gives you hint.
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
hope that it works out.
For those of you running Windows Server 2012 the Application Development features are found at
[] Server Roles
[] Web Server IIS
[] Web Server
[] Application Development
[] ASP.NET x.x
When you select the .NET version it will ask if you want to add Extensions and other features. I just said yes, but you may be able to get away without installing those.
its hard to give a specific answer here, but the basics of it are that you need to look at the machine.config for the box you're running on. find the system.webServer node and look for the 3 tags/attributes its referencing in the error. chances are you'll find something that is marked as not overridable (allowOverride="false"), but i've not messed with windows 8/server 2012 yet, so i don't know what the machine.config looks like.
You can unlock the section via the IIS UI per https://serverfault.com/a/516921/137255
Open IIS Manager
Click the server name in the tree on the left
Right hand pane, Management section, double click Configuration Editor
At the top, choose the relevant section based on the offending item's XPath; i.e. system.webServer/modules for this example.
Right hand pane, click Unlock Section

How can I debug MonoDevelop add-ins with MonoDevelop?

The topic says it all. I cannot find any information on the monodevelop site or through google.
Even adding System.Diagnostics.Debugger.Break() and running with mono --debug MonoDevelop.exe doesn't seem to do anything..
mono --debug doesn't have anything to do with the debugger, it simply causes Mono to track debug information so it can give you file/line/col information in backtraces.
The behaviour of System.Diagnostics.Debugger.Break() depends on your Mono version. AFAIK in its basic form it sets a hard breakpoint, so if your app's not running in a native hard debugger it will simply crash. If your app is running inside the Mono Soft Debugger with Mono 2.11 or later (which has not yet been released), it will set a soft breakpoint for the soft debugger and work as expected.
The basic way to enable debugging of addins is to set a custom execution command in your addin project. Open 'Project Options', got to the 'Run>Custom Commands' section, add a custom command for 'Execute'. Set the executable to MonoDevelop.exe and the working directory to be its containing directory. This means that when you run/debug your project, MD will actually execute that executable instead of executing your project directly. If MonoDevelop.exe loads your addin, then you'll be able to set breakpoints, step, etc.
The difficult part here is making MD load your addin. One way to do this would be to have your project output the addin dll into one of the directories that MD searches for addins, but that's a very hacky thing to do at development time. A better solution is to use the undocumented environment variable MONODEVELOP_DEV_ADDINS to specify an additional directory from which for MD to load addins. There isn't a UI in MD for setting env vars for custom commands, but it is supported internally - you'll have to manually edit the csproj file.
Find the part that looks like:
<CustomCommands>
<CustomCommands>
<Command type="Execute"
command="..\..\..\monodevelop\main\build\bin\MonoDevelop.exe"
workingdir="..\..\..\monodevelop\main\build\bin" />
</CustomCommands>
</CustomCommands>
And change it to:
<CustomCommands>
<CustomCommands>
<Command type="Execute"
command="..\..\..\monodevelop\main\build\bin\MonoDevelop.exe"
workingdir="..\..\..\monodevelop\main\build\bin">
<EnvironmentVariables>
<Variable name="MONODEVELOP_DEV_ADDINS" value="${TargetDir}" />
</EnvironmentVariables>
</Command>
</CustomCommands>
</CustomCommands>
If you're wondering why the <CustomCommands> elements are two-deep, that a known bug.
the soft debugger doesn't yet support System.Diagnostics.Debugger.Break(), so that won't work.
You just need to debug MonoDevelop inside MonoDevelop and set your breakpoints on the source files of your addin.

Unable to start program 'http://localhost/Default.aspx'. VS2010

I cannot start my website from Visual Studio 2010 anymore.
For a few days I cannot start my project in a web browser using F5. When I open my web application directly by typing the same url 'http://localhost/Default.aspx' everthing works fine.
When I run the project (F5) a new webbrowser starts, but after a few seconds it is stuck and Visual Studio gives an error dialog:
Microsoft Visual Studio
Unable to start program 'http://localhost/Default.aspx'.
OK
When I run the project in release mode it gives an extra error:
Microsoft Visual Studio
The following module was built either with optimizations enabled or without debug information:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6552bec6\694bce32\assembly\dl3\8c9bd8d8\fb1d75cb_af26cc01\[name].Presentation.DLL
To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
OK
I have already repaired, removed and reinstalled Visual Studio 2010, I've tried using different browsers (including Chrome and Firefox), used different aspnet_regiis.exe options, etc. etc.
Nothing helps, and yeah now I'm stuck pulling hair out of my head ...
Anyone any idea how to solve this?
Does it work if you start it with [CTRL]+[F5] which runs without the debugger?
If so, then you have an issue with the debugger auto-attaching to the web server. I would check that debugging is enabled for your web project - a warning that usually crops up automatically from VS when it detects that a project is not built in Debug mode.
This is not as simple as switching the project configuration over to Release, because the DLL that the debugger is moaning about is one of the dynamically generated ones originated by Asp.Net itself.
Typically you should have, in your web.config:
<configuration>
<system.web>
<compilation debug="true" >
</compilation
<system.web>
<configuration>
(Along with any other stuff in <configuration> and <system.web> nodes).
There's also the possibility that Asp.Net debugging is not, for some reason, enabled.
Check out this msdn article on debugging asp.net applications in VS2010 for more information.
Note that if this is VS010 express, then you won't be able to debug - as confirmed by the aforementioned link; but since you way it used to work then I guess that's not your problem.
Update
Since that hasn't worked - you can try emptying the Temporary ASP.Net files folder. Easiest first is to do an iisreset. Then navigate to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and delete everything in it. I've had issues in the past where the Asp.Net binaries don't get refreshed and so when I'm debugging it moans that the files are out of date.
Change the View Browser to another browser. Run the view in browser or debug, then change back to original browser should work after that.
Had same problem, answer for me was to remove Avast Free AV. Everything worked for a year with avast free up until a week or so ago, uninstalling it fixed the problem.
I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".
Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
Debug away! Your app should come up in your browser now and debug as normal.
the solutions for me is to test with 127.0.0.1 in place of localhost. and all goes well for.
so the problem come from the host resolution name, to solve it please proceed like :
open cmd and then tape : %systemroot%\System32\drivers\etc\
open hosts file with notepad and the look for localhost ligne(you'll find 0.0.0.0 befor it )
change the 0.0.0.0 with 127.0.0.1 at all lignes with localhost .
I solved in this way:
Right click on a aspx page
Browse with set internal browser as default
Remove the previous default browser
Add %programfiles(x86)%\internet Explorer\iexplore.exe
Set this choice as default
For me I just did a Build /ReBuild on the project level and it started working!!!
I had the same problem. When I debug my code it says:
Unable to start program 'C:\homework.exe'. this system cannot find the file specified."
I'm using Microsoft Visual C++ 2010 Express but when I made a new project by the following steps:
Open C++:
Press new project
Press win32
Press win32 Console Application
Rename it
Click next
make sure: that the application type is console application
additional options: empty project*
Press Ctrl+Shift+A
In Visual C++/Code section press C++ File (.cpp)
rename it and press add
It works fine with for me now.
Please set your page name e.g Default.aspx revert to parent in IIS configuration
I'll share my experience with this same problem. This is not a solution, but someone may be able to figure out the problem from my particular experience.
I've been having this same problem for a few weeks now. (I don't know what changed on my system.) I do not run as local admin, because we are not allowed to have admin privileges on our PCs where I work.
Until today, I could expect F5 (Start Debugging) to start up a new local VS web server, open an IE window, and then issue an "unable to start program http://localhost:nnnn/Login.aspx" and "access is denied" error pop-up. If I closed the IE window, waited a few seconds, and then clicked F5 again, it usually started up my web app in debug mode just fine from that point on.
But today, that all changed. I did not change any configuration on my web app, which has been running fine, but I did add a couple of more classes to one of my subprojects. At this point, I could never get past the "unable to start program" message. I could run my app without debugging, but that was rather pointless. I even tried attaching to a running (non-debug) IE process, but that did not work.
Finally, I modified some of the properties in the WebAppName >Web >Servers screen. Specifically, I enabled "Specific port" for a specific HTTP port (which VS had been using all along), and I disabled "NTLM Authentication". I also enabled "ASP.NET" in the Debuggers section. Some of these I first clicked, then unclicked, then clicked again, saving in between each click.
This time, running with debug (F5) worked.
After running several times, I still usually get a "unable to start" error the first time after a recompile, but I can still usually get a debuggable running app to start after the second or third try. At least I'm back to where I was yesterday.
I suspect it has do with VS reloading its execution profile, and also probably something to do with permissions (since I cannot run as admin).
I'm using VS2012 with an ASP.net app that was written using VS2003... I've tried everything to get the IE page to open automatically when I select F5, or even Ctrl+F5... Haven't been able to get anything to work... However, I have stumbled upon a very poor work-around. When I select debug and I get the 'Unable to start program...' msgbox... I noticed that on the icon-tray I get a msg saying local-host has started
You'll notice a picture that the msgbox is pointing to:
Well, if you right click it, you get three options:
When you select the first: 'Open in Web Browser', it will open IE with the page your working with...
Like I said, it's a very poor work-around... but it works. This isn't an issue when I select debug using 'Chrome' or the page-inspector... But they have their own issues.
Try to turn on Bypass proxy for local addresses.
First you can go to your browser settings-> Change proxy Settings-> Connection-> Lan Setting and just check bypass proxy for local addresses.
If this solution don't work then also copy the following code check your web.config file for settings to bypass firewall:
<system.net>
<defaultProxy>
<proxy usesystemdefault="true" proxyaddress="http://proxy:port" bypassonlocal="false" />
</defaultProxy>
</system.net>
I easily resolved this problem by enabling script debugging in the browser.
When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.
Since then, I have made a .bat file with this code:
taskkill /F /IM iexplore.exe /T
so now I just run the .bat when I get that error.
(alternatively you could run that code from the cmd)
I just ran into this problem in Visual Studio 2013. I had to enable Anonymous Authentication.
Click on the project node in solution explorer.
Hit F4 to show the properties window.
Change the Anonymous Authentication option to Enabled.

Where in the registry can I find the current setting of an IE8 policy?

I have set the following policy with gpedit in a Windows Server 2008 machine that has IE8:
I have a source that tells me that configuration resides in HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoExtensionManagement -- but that's a lie. There isn't even an Internet Explorer folder under Software\Policies\Microsoft.
Moreover, the same source says the setting is under "Computer Configuration\Network\Internet Explorer\Do Not Allow Users to enable or Disable Add-Ons" on gpedit. As you see above, that isn't true either.
OK, the "source" I'm talking about is the US Government: http://usgcb.nist.gov/usgcb/download_ie8.html -- namely, their IE8 OVAL definitions.
So, where in the registry is that setting?
It is an either/or. The policy can be implemented via the registry OR the GPO. You'll find your GPO where it is set in something like:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{71DA9274-FD7B-4660-A801-B013570D3F5F}Machine\Software\Policies\Microsoft\Internet Explorer\Restrictions
or
HKEY_USERS\S-1-5-21-2090352725-1269969352-1905203885-2959\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{71DA9274-FD7B-4660-A801-B013570D3F5F}Machine\Software\Policies\Microsoft\Internet Explorer\Restrictions
though the GPO itself is stored on disk, and not the registry ... I think here:
%systemroot%\System32\GroupPolicy
As far as where you'll find various settings in gpedit - it does depend on your version of windows.
After getting hit with some unwanted intrusive piece of software, I couldn't reset the IE8 settings on my Windows XP machine (yes, I know how old that is). Found the problem - the "Control Panel" settings had an additional registry entry in HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
The zonemap under this registry key had 1803 disabled. That made three different entries for the same value in the registry. It wasn't IE8, it wasn't Group Policies. It was a rogue copy hidden in the HKLM that overrode other settings.
Symptom included that message "some settings controlled by Group Policy ..." Well, who's the group, exactly, on my tablet.
The Microsoft KB182569 is excellent. The only missing data was where to find the "unwanted" copy of zones.

Resources