PortableApps.com Platform and Suite 1.6 have been released.

SelectBrowser

Submitted by jeff93063 on October 12, 2009 - 3:39pm

I'm working on a "set default browser" utility which will be a little more portable-friendly than the alternatives that already exist.

You can get version 0.005 for testing and feedback here: http://www.csun.edu/~jas75018/index.html

Consider it an Alpha at the moment, since a lot of testing and improvement are still needed. It's not going to blow up your PC, but just in case you run into trouble you can always go to Control Panel > Internet Options > Programs > Set Internet Explorer as Default Browser.

Thanks
Jeff


( categories: )

DefaultMyFFP?

Maybe you could use Ryan's DefaultMYFFP for some inspiration.
BTW, how exactly is it going to work? Do you choose a launcher and it does all the necessary associations, or do you choose from a list?
I can't wait to see a real USB "docking station" where you can back up your drive, run all the USB programs as if they were the installed versions, etc. etc. Eye-wink

Insert original signature here with Greasemonkey Script.

Cool, I'll be following this

Cool, I'll be following this closely. This line in your source is wrong and should be:

DllCall("user32.dll", "int", "SendMessageW", "hwnd", 0xFFFF, "uint", 0x001A, "wparam", 0, "wstr", "Software\Clients\StartMenuInternet")

Have you had a chance to test this on Win7? I've tried my version (using your exact method) but can't get it to work for links from within programs (like from an about box with a link to a homepage). I don't have XP to test, but I've seen this method for XP in many places, so I assume it works for that.

From what I've read, the StartMenuInternet stuff is not necessary for a 'Default Browser' setting, only for the Start Menu links, which don't even exist on Win7. But so far changing the protocol settings don't do anything. It may require logging off / loggin on, in which case it's kinda pointless. I'm still researching, but info on Win7 is scarce. I'm gonna try to figure out what the 'Default Programs' settings actually change.

PS -
Also check out _PathGetRelative() and _PathFull() functions to make your life easier.

Thanks for that correction.

Thanks for that correction. Do you have some kind of reference that tells what you can do with user32.dll? I found that line on the AutoIt boards and it worked for refreshing the start menu browser, but I didn't really understand what it was doing.

I haven't tried this on anything but XP. I guess it's time to break out the virtualbox and see what happens.

You are correct, StartMenuInternet just controls what shows up on the XP start menu. The http, https and ftp protocol associations are supposed to take care of everything else.

I started looking into the Win7 stuff, and it looks like the magic happens in
HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ so I'll keep digging there until I get it working.

Version 0.003 released. It

Version 0.003 released. It seems to work on Windows 7 as far as I can tell. You can type an http address in the start menu search box and it opens in your browser of choice. Wraithdu, please let me know if this works for you as expected.

I'll check it out and let you

I'll check it out and let you know. Maybe the same for Vista as Win7? I don't have Vista anymore to test though.

Here is where I found the info for the correct message to broadcast. It's about half way down in the paragraph about broadcasting the WM_SETTINGSCHANGE messaage.

http://msdn.microsoft.com/en-us/library/dd203067%28VS.85%29.aspx

Wow, that information would

Wow, that information would have been useful when I first started this Smiling

That info makes me wonder if anyone would like a version that registers PortableThunderbird as the default mail client.

Good Idea

Here is another idea you can develop.

I hate those outlook express popups !

So an idea would be to redirect to thunderbird, that's good.

But what about also redirecting to open a URL link (with the default browser that should pick it up) to point to GOOGLE for example.

Also, maybe a popup your default .TXT editor so that you can copy the email and send it manualy to google.

That would be GREAT and would complete my total portable world loop (I have NOTHING installed on my system, everything is portable).

I just install, HIT PFA ASSOCIATION, and BOOM -> complete functional system on a new install !

Awesome, 0.003 works well in

Awesome, 0.003 works well in Win7. Where did you find that info?

I'd like to hear back from ShalowUser to see if he has any more problems before implementing this in PFA.

I just ran Process Monitor to

I just ran Process Monitor to watch for registry adds and changes and then used the "set default applications" or whatever they call it in Win7. I watched what was changed and added it to my app.

I don't have Vista for testing either. I guess we'll have to wait and see if someone pops up with problems.

Thanks for the feedback.
Jeff

Windows Messenger Does NOT work.

I tried 0.003 version.

Everything seems fine except windows messenger doesn't work.

Maybe use the what has changed application that monitors the .reg entries with the below app (defaultbrowser)

All the info is in the post below

Something is fishy in here ...

Here is what I did...

I reset everything... Used DefaultBrowser, resetted from inside defaultbrowser, then resetted using the control panel internet explorer. I also checked IE to warn me if he is not the default browser anymore.

Then I went back to 0.003 and used it. Messenger links now work, but it's the links inside my email client that no longer work.

What is more interesting is that as soon as IE is launched using the email link client, it doesn't tell me that it's not the default browser anymore. It acts as if it's still the default app.

So, what gives ?

What email client are you

What email client are you using? What OS? I have to use Outlook 2003 at work and it is not smart enough to detect default browser settings when you click a link. You have to restart Outlook before link-clicking will work.

As far as IE, you can go to control panel > internet options > programs and near the bottom there is a button that will be grayed if IE is still default.

Thanks for your debugging help. I'm sure we'll get these all fixed.
Jeff

I'll repost my post here.

Thanks for your reply :

usually, with these sort of apps :

"YASDBA"

Yet Another Set Deefault Browser Application

Having multiple browsers is a good idea.

What's the icon thing ? Is it for the application itself or system wide ? Because PFA can already play with the icons of html shtml and htm system wide.

THE OLD version worked with messenger, the new version you put online doesn't. And I don't know why. Not only it doesn't work, but it creates a portable firefox .exe process (ghost) with 855k of memmory consumed each time i click on it.
The old version rocked !

Also, the Start Menu thing should be left alone, as 1) Everyone has his own portable launcher. 2) Sometimes I need internet explorer for windows update.

Thanks for putting the old version back up !

Maybe some sort of change log ?

cheers !

=======================
I did some testing :

Using your software, it works in email,other programs,and rss feed programs but not inside Windows live Messenger. If I revert back to microsoft (ADD/Remove software), it reverts.

Using this software : It is similar to your program. But it displays an error when i click the link in email programs and other win programs (cannot find link). So yours is better. www.pc-tools.net (setbrowser). I canr evert with windows too.

Using this software : http://windowsxp.mvps.org/defaultbrowser.htm It works nicely in all programs except the RSS Feed program. BUT reverting to original can't be done from windows (ADD/REMOVE programs, reset defaults), it has to be done using the same program using the reset button(Defaultbrowser). Otherwise it won't revert and it will stay on your portable device.

So a perfect combo would be yours and the one in defaultbrowser

Maybe a bug, but when you click twice on 'set default', some .reg files are created inside the program folder. 4 to be exact with some information about your pf (jeff)

Cheers and hope it helps.

Maybe a small bug.

With version 0.003

When I choose the browser, and set default. No files are created.

When I go in the second time and press it a second time, a bunch of .reg files are created.

Do those take time to refresh or I have to press twice ? My guess is that it's a refresh problem from my pc.

Glad to help !

I have WIN 32 XP PRO SP3

I'm glad to help as I'm hoping for the only solution out there to mailto and urlto default portable.

The thing is, even after I close it and turn it back on it doesn't work.

It used to work perfectly before with (defaultbrowser) so I know this is not a faulty email program.

Here are the areas I am testing, and I always fail randomly at one of them (windows messenger and email mostly).

-Clicking a link inside the Email client (The Bat)
-Clicking a link inside windows live messenger
-Launching a URL shortcut from inside windows explorer (I have html, htm and all the rest open with notepad++)
-Clicking on a About bot and clicking on the link that takes me to the website
-Launching links from my RSS viewer
-clicking on Internet Explorer from the Start Menu and ensuring that it actually launches the internet explorer and not something else (for windows update and not to mess up with the start menu).

I got them all working with 0.003 BUT windows live messenger and the email client. The weird thing is that when I play with the settings, go back to defaut, revert back, start your software from 0 and reset the defaut values. I sometimes switch from WLM and the Email client not working. One or the other.... Which I don't get.

Maybe this software can help you :

http://majorgeeks.com/What_Changed_d5018.html

It will let you scan a registry, rescan it after the software had made changes, and it will dish out a .reg key to see what changed.

Cheers and keep up the good work !

@ShalowUser I have a quick

@ShalowUser
I have a quick and dirty test app that I'll post in a while for you to try. It makes the changes on startup, then removes them on close, sits in tray.

Make sure you shut down all your test apps, then run it, then reopen them to try the links.

ok.

Got it, i'm traveling tomorrow, so i'll try it on Wifi band, if no wifi available, would be back end of week.

until then, have fun boys !

@Jeff: I replied to your great mailto: idea above. Smiling

Ok, try this out. Set the

Ok, try this out. Set the path to your desired browser in the INI file, no quotes.

Browser Test 0.1

Unable to Reset.

I have been unable to make windows live messenger open links with internet explorer again.

So until then, I can't test the apps properly.

I use the control panel settings, even IE, and everything else doesn't work. Everything opens in IE except WLM

Things to try: 1) make

Things to try:
1) make Firefox your default browser, then make IE the default (both done with each program's built-in functionality)
2) reinstall WLM

What browser is WLM currently opening links with?
3) search the registry for that browser and see if anything looks weird

Research

Ok, here is a bit of research that I have done, seems like we need to do some changes as some apps use a dll to call the default browser :

Quote:
================================================
Please see the registry keys that we have been playing with. The changes we made seem to work for us. Use the file at your own risk. I can't provide any support if things go wrong.

We resolved our problem by making the above changes to the registry and also invoking the rundll32.exe process outside the virtual environment. The application that was trying to launch the default browser was doing so by calling rundll32.exe.
=================================================

I actually found that

I actually found that quote...which surprised me. I have confirmed that my test app correctly redirects both ShellExecute() and rundll32 methods of launching URLs (at least under Win7).

For reference, the rundll32 method. Run at a cmd prompt, where <URL> is the URL you want to navigate:

rundll32 url.dll,FileProtocolHandler "<URL>"

Hummmmmm

Doing what you did actually runs firefox correctly. Which seems to indicate that the default browser in windows in portable.

I have a little doubt about my setup, maybe it's the cause of such a mickmack.

Do sandboxed applications pose a certain problem with this ? My guess is that they shouldn't. I have a lot of virtualized applications that are supposed to pickup the default browser. All of them do actually BUT one, which is the links i click in my email client (it open internet explorer). It used to open firefox with other default browser software so i don't really know there.

Can't we have an app that monitors the rundll and whatnot commands that an app sends to windows ?

Also, once last thing, NOT AT ANY MOMENT, with any of wraithu or jeff's software does internet explorer says that he is not default. It always opens up as if nothing is there.

with other softwares, it used to ask me that it is not default anymore.

Did you change all protocols ? The gopher url, the internet shortcut, ect ? Because in File Types, under options, there are still a lot of stuff associated with iexplorer.exe

One final thing worth noting is that when i right click the start button, choose properties, then go in the start menu, i can choose my browser application. And I can see THREE firefox proggies in there. Could it be that windows remember all the associations are being done or is it that all programs write to different places making it three seperate registry entries ?

cheers

Ok, I am starting to see a pattern !

Ok, Here is what my testing gave me :

1- sandboxed and virtualized applications behave like installed ones.

2- In the bat : A link of the type http://www.blabla.com/ Opens Internet Explorer

a link of the type blabla coded in html opens up the portable broser (yehaaa)

3- In windows live messenger, links don't open in portable browser.

These tests where done with 0.003 version.

So there seems to be a third type of links inside the mail programs, those who appear under plain text and that the program translates to a link, it must call up the url with a different process

Working

Again and again, listen to the complete story :

Here are the Links that should be tested :

1-Internet Shortcuts from Windows Explorer
2-Links from about boxes in programs
3-links in windows live messenger (and other messengers)
4-TEXT links from the bat or any other mail client
5-HREF links from the bat or any other mail client
6-Links from RSS Feed readers SNARFER PORTABLE

I can see instant change in the behaviour of all 6 points above when I do my modifications.

-If I use SetBrowser First 0.003, then 3 and 4 don't work
-If I use DefaultBrowser on Top of SetBrowser 3 work, 4 still doesn't work and 6 STOPS working.
-If I do SetBrowser pass one more time, then only 4 doesn't work.

It seems that defaultbrowser is overwritting some setbrowser settings but is getting one thing right, and that's to make the links work in windows live messenger.

Both programs couldn't get the PURE TEXT links to work inside the mail app (the mai program underlines the sentences starting with http:// and make them clickable). But both of them were able to make the HREF links work in the exact same program.

Also when I ran both programs, then opened IExplorer directly, it didn't tell me that it's not the default browser anymore and that it needed to be changed

That's the Summary my friends ! I don't think anyone got as deep into this as us on the net. Phewwwwwwwwwwwwwwww

What do you use for

What do you use for virtualization? The reason I ask, is programs like Sandboxie keep a virtualized registry that takes precedence over the local registry. So changes in the local registry are not seen in the virtualized registry if the keys/values already exist in the virtualized registry. Perhaps this is why you are seeing erratic behavior. In other words, if the default browser settings exist in the virtualized registry, then changes in the local registry are not seen and will have no effect. Even worse is if only *some* of the keys are virtualized. Now you have an inconsistent mix.

I think we can only debug this process with normally installed local and portable apps. Virtualization is a problem we cannot tackle.

No, I don't set all protocols in my test app, only ftp, http, https. And no, there is no way to intercept app calls to DLLs or rundll32.

Actually

While this may be true, I have actually witnessed quite a responsive change in the behaviour of virtualized applications. When I change the default browsers back, it reverts.

I'll wait for the selectbrowser version that covers the terrain I have explored

Have you tried either my test

Have you tried either my test or SelectBrowser along with PFA running set to redirect .htm, .html, and .url filetypes?

Yup

SelectBrowser 0.003 + DefaultBrowser + PFA works in all cases just fine.

it opens html and htm files in explorer and url files everywhere.

except point #4 in the above list.

Updated to 0.004. A lot of

Updated to 0.004. A lot of improvements, so give it a try. Note: an old ini file won't work with this version.

ShalowUser, I haven't addressed your bugs yet. I wanted to get this to a stable working base first, which I think I've done. Now I can start trying to replicate your problems and solving them. Please give this version a try and let me know what does and doesn't work.

Jeff

ShalowUser, I did some

ShalowUser, I did some investigating and it seems that Firefox (even portable Firefox) expects a few command-line parameters when a link is clicked in another program.

On SelectBrowser 0.004, try this in the "Association Arguments" box:
-requestPending -osint -url "%1"
instead of the usual "%1"

Give it a try and let me know if it fixes your problem.
If so, in 0.005 I will make it detect if you're adding a Firefox browser and automatically fill that in for you.

Thanks,
Jeff

i'll try... did you see the

i'll try...

did you see the above posts ?

Yes, and I'm trying to make

Yes, and I'm trying to make it so you don't need DefaultBrowser anymore. My app should be able to help with everything except the plain text links. There's no way to make those open in a browser unless the application you're in converts them to links. Right now SelectBrowser works great for me, and I've tested multiple browsers with web links from Outlook, Miranda IM, Solidworks, Adobe Acrobat, and desktop links. Everything works for me. Let me know if the Firefox arguments help and I'll release .005.

Jeff

nope

OK 1-Internet Shortcuts from Windows Explorer
OK 2-Links from about boxes in programs
NOT OK (defaultbrowser gets this one) 3-links in windows live messenger
NOT OK 4-TEXT links from the bat or any other mail client
OK 5-HREF links from the bat or any other mail client
OK 6-Links from RSS Feed readers SNARFER PORTABLE

you have two misses. the thing is that http:// or www. links in the mail program are UNDERLINED, which means that they are clickable. I'm not talking about plain links. When I click on them, IE opens up.

After I use your software, internet explorer doesn't say that it's not default, it acts as it always was and never changed. Weird.

Also, about your MAIL URL catcher, I stumbled on something interesting. This might fix it :

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office]
@="Group-Office"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office\Protocols]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office\Protocols\mailto]
"URL Protocol"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office\Protocols\mailto\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office\Protocols\mailto\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Group-Office\Protocols\mailto\shell\open\command]
@="rundll32.exe url.dll,FileProtocolHandler http://demo.opensourcecms.com/groupoffice/modules/email/mailto.php?mail_to=%1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail]
@="Group-Office"

-------------------------------

it launches an email browser client.

no one here ? where did

no one here ?

where did everybody go ?