Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As many are painfully aware of, Oracle continues to not only bundle the Java installation with the useless Internet browser toolbar from Ask.com, but also enable its installation by default. In addition to the toolbar, Ask also replaces your favourite search engine in your browser with Ask.

Furthermore, the Java installation goes as far as to actually recommend installing this useless junk, meaning that any non IT-savvy person is more than likely to leave it checked and install it (after all, it was enabled by default and the friendly Java installer did recommend it, right?).

To add insult to injury, even if you remove the Ask Toolbar, you can be sure to see it again soon, when the next Java update hits you (which seem to happen quite often lately, due to loads of security fixes for Java, but that's another story).

I'll duly remove the check-mark to install Ask Toolbar, whenever I update Java, but when supporting my family and friends, it's obvious they don't.

How can I prevent the pesky Ask.com Toolbar from being installed in the first place?

share|improve this question
up vote 245 down vote accepted
+150

Digging a bit into the problem myself, I've found that there's an hidden switch to disable sponsor offerings in the auto-update installer.

Open the following keys into the Windows Registry Editor (regedit.exe):

  • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft (available only on Windows 64-bit)

and create in both of them a new String Value (type REG_SZ) named SPONSORS of value DISABLE (both name and value must be uppercase).

Alternatively, copy and paste the following code into a text file called disable_java_sponsors.reg and double click on it to import these values in your Registry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
"SPONSORS"="DISABLE"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft]
"SPONSORS"="DISABLE"

Please note that this switch not only disables the Ask.com toolbar installation and prompt, but disables all of the sponsors potentially bundled with the Auto-update setup/Online setup (Google toolbar, Yahoo toolbar, McAfee something, etc...)


Another way, without having to download and rename or create a new .REG file, is to copy and paste the following two lines into an elevated CMD prompt:

reg add HKLM\software\javasoft /v "SPONSORS" /t REG_SZ /d "DISABLE" /f 
reg add HKLM\SOFTWARE\Wow6432Node\JavaSoft /v "SPONSORS" /t REG_SZ /d "DISABLE" /f
share|improve this answer

Edit 2014-02-02: With JavaRE 7u51, Ask toolbar now installs into a subfolder named "AskPartnerNetwork" instead of "Ask.com". One could have suspicions about what the point of that is... Meanwhile, @Danilo Roascio's registry values are still obeyed and works just as well as before.

This just highlights that the simple registry fix, is still the simplest and best solution. In case the Java installer changes, so that this registry value is ignored, the following script can still be used as a workaround - just make sure the Ask Toolbar path is updated.


The simplest way to prevent Ask Toolbar from being installed again I could think of, was to create the folder Ask Toolbar installs into and modify the permissions, so no one can write to it.

First, make sure that the Ask Toolbar has been removed. Then copy the following code to Notepad, save it as a .cmd file and run it in an elevated command prompt:

REM Detect processor architecture
set proc_arch=x64
if "%PROCESSOR_ARCHITECTURE%" == "x86" ( 
    if not defined PROCESSOR_ARCHITEW6432 set proc_arch=x86
) 

REM Define Ask Toolbar path
if "%proc_arch%" == "x86" set AskPath=%ProgramFiles%\Ask.com
if "%proc_arch%" == "x64" set AskPath=%ProgramFiles(x86)%\Ask.com
set AskReadme=%AskPath%\..\Ask.com_ReadMe.txt
set AskRevert=%AskPath%\..\Ask.com_RestorePermissions.cmd

REM Create dummy Ask Toolbar folder
md "%AskPath%"

REM Add explanatory text file, as to why the dummy folder is there
echo The 'Ask.com' folder is has been created and write protected,> "%AskReadme%"
echo in order to prevent Ask.com Toolbar from being 'accidentally'>> "%AskReadme%"
echo installed, e.g. by Java.>> "%AskPath%\readme.txt">> "%AskReadme%"
echo.>> "%AskReadme%"
echo This has been done using ICACLS by denying write access to the>> "%AskReadme%"
echo EVERYONE security group.>> "%AskReadme%"
echo.>> "%AskReadme%"
echo To revert permissions run:>> "%AskReadme%"
echo %AskRevert%>> "%AskReadme%"

REM Create script to remove restrictions
echo icacls "%AskPath%" /remove:d *S-1-1-0> "%AskRevert%"

REM Deny everyone (SID: S-1-1-0) write access
icacls "%AskPath%" /deny *S-1-1-0:(OI)(CI)W

Please note: ICACLS is included in Windows Vista and later. You can download ICACLS for Windows XP/Server 2003 through Microsoft KB919240, or an updated version through KB943043 (but the latter must first be requested, after which you will receive a link by e-mail to download it). For this purpose, both versions should work equally well.

I have verified with the installer for Java 1.7 update 13, that the Ask Toolbar indeed does not install, even if I leave the checkbox checked.

A similar approach can most likely be used to block most other kinds of piggybacking crapware.

Edit #1

Windows Explorer quirk: Access denied

Windows Explorer behaves a little strange if you try to open the folder. Even though you still have read access to the folder, Windows Explorer will tell you that access is denied, even though only write access has been denied.

This doesn't happen if you simply only have been assigned read access in the first place, but it seems to happen when you have been assigned read/write permission to the folder and then been denied write access.

Reverting permissions

The script has been updated to add a 'read me' text file and a script for removing the restriction again. Both are stored in the 32-bit program files folder.

share|improve this answer

Consider using https://ninite.com/ Select all the apps you want it to install/update, and with a single click it'll install only those apps, w/o extra garbage like Ask toolbar in java. If a system already has the latest version of a given app, Ninite will skip that install. Also you don't need to regenerate its package every time. The same .exe will ensure that you always install the latest versions. Just tell your friends/family to run it once a month and it'll make sure they are always up to date.

Update: Alternatively, if you install JRE from http://www.oracle.com/technetwork/java/javase/downloads/index.html it does not come with Ask or McAfee toolbars. (Not sure about auto-update afterwards).

share|improve this answer

Another method is to prevent DNS resolution of the ask.com domain. I tested this by setting my network's DNS cache/resolver (Unbound) to refuse queries for ask.com and then updating java with the ask toolbar box checked. Result was no installation.

This method has the drawback (if you consider it such) that the ask.com domain will be unavailable. But it has the bonus that ask.com "infected" systems may be discovered (as users may have search issues) allowing for disinfection to be undertaken.

Another positive is that no changes are needed for each computer. The DNS solution works for all systems immediately and simultaneously. Note that other DNS caches must be blocked - which is quite typical in most controlled environments - the firewall prevents access via port 53 to outside DNS from all but the internal DNS cache/resolver.

share|improve this answer

Nov 2014: Answers here are largely outdated as Oracle has now disclosed this. Or at least we can say there's now an "official" solution.

First of all: The Ask toolbar has only ever been included as an option with the Consumer version of Java installer (the one you get from java.com) whereas the Corporate version of Java installer (the one you get from java.sun.com) never had it. So the problem about the Ask stuff has "only" been a problem for private individual type users. I put "only" in quotation marks because I too have been annoyed by it. Its not a discussion that has existed in corporate IT department, simply because the option wasn't there.

Ok, let's focus on the Consumer version of the Java installer.

Nowadays the Java widget on the Windows Control Panel has an option to permanently disable the "prompts" where you are asked about Ask and where you previously had to remember to unselect the option.

You'll only have to do this once and then never again. I still would have liked Oracle to remove it altogether from the Consumer version of Java but this solution at least means you only have to say "no" once.

There's is a command line option as well. More information here.

share|improve this answer

For those of you interested- I created administrative templates (one for x86 and one for x64) that can be used for Group Policy. They've been tested and work in XP and Windows 7.

For more information on this procedure, click here.

In Group Policy you may need to go to View menu, click Filtering and uncheck "Only show policy settings that can be fully managed."

Save the following file as templatenamex86.adm and import in Group Policy:

CLASS MACHINE

CATEGORY !!cat01

KEYNAME "Software\JavaSoft"
POLICY !!polname

  SUPPORTED !!supOSes
  EXPLAIN !!poldescr

    PART !!msg01 EDITTEXT REQUIRED DEFAULT "DISABLE"
    VALUENAME "SPONSORS"
    END PART 

END POLICY


END CATEGORY

[strings]
cat01="Java Update Sponsor Offers x86 Windows"
polname="Set Value"
supOSes="Windows 2000+"
poldescr="Enabling this policy and leaving this field reading "DISABLE" will remove sponsor offers during Java updates"
msg01="DISABLED = Sponsor Offers Disabled"

Save the following file as templatenamex64.adm and import in Group Policy:

CLASS MACHINE

CATEGORY !!cat01

KEYNAME "SOFTWARE\Wow6432Node\JavaSoft"
POLICY !!polname

  SUPPORTED !!supOSes
  EXPLAIN !!poldescr

    PART !!msg01 EDITTEXT REQUIRED DEFAULT "DISABLE"
    VALUENAME "SPONSORS"
    END PART 

END POLICY


END CATEGORY

[strings]
cat01="Java Update Sponsor Offers x64 Windows"
polname="Set Value"
supOSes="Windows 2000+"
poldescr="Enabling this policy and leaving this field reading "DISABLE" will remove sponsor offers during Java updates in 64-bit Windows"
msg01="DISABLED = Sponsor Offers Disabled"

You should see them in Group Policy now:

I hope this information can help others keep this garbage off their networks too!

-Mike

share|improve this answer

This was mentioned in the comments, but not clearly explained in any of the answers:

The offline Windows installer for Java doesn't prompt to install the Ask Toolbar. The link to the installer for the Java SE JRE (if you don't know what SE or JRE means, then this is what you want) is currently at:

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

The Windows offline installer for x86 (i.e. 32-bit software, includes most browsers) is clearly marked. The 64-bit installer seems to be offline-only.

share|improve this answer

The javaruntime package on Chocolatey appears to avoid installing the Ask toolbar. I've been running that package and, unfortunately, the auto updater, and have not seen the Ask toolbar installed after an update from this initial source. I suspect the java updater adheres to the original installation parameters.

FYI, Chocolatey is a command-line Windows application/package manager, like apt-get for Linux.

share|improve this answer

protected by slhck May 15 '13 at 15:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                       <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\n                </div>\n            </div>\n\n            <div id=\"copyright\">\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\n            </div>\n            <div id=\"svnrev\">\n                rev 2016.2.9.3241\n            </div>\n            \n        </div>\n    </div>\n    <noscript>\n        <div id=\"noscript-warning\">Super User works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\n    </noscript>\n<script>v"], "copyright__copyright__copyright": ["Chocolatey is a command-line Windows application/package manager, like apt-get for Linux.\n\nshare|improve this answer\n\nprotected by slhck May 15 '13 at 15:41\n\nThank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.\n\nWould you like to answer one of these unanswered questions instead?\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}