You are here

Portable App version of DLLHELL

12 posts / 0 new
Last post
Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
Portable App version of DLLHELL

I stumbled upon something that Microsoft made available to the Windows 2000 and XP operating systems. There are two ways to ensure an application uses the correct .dll and .ocx files without having to register these files using the systems registry. The first is called DLL/COM redirection (windows 2000). The second is called side-by-side assembly (windows XP only).

To get to the point and then give details after, I've been able to use side-by-side assembly to successfully redirect ccleaner.exe to use the required .ocx and .dll files without registering them in the registry on my Desktop XP Pro.

The way I did this was to create a manifest file using a little tool I found called
tregman.exe. You can find it at http://blogs.borland.com/cbensen/archive/2005/08/18/20809.aspx
or you can create your own .xml file, but tregman is a command-line tool and does it much quicker. I added this manifest file to my ccleaner folder where my .dll and .ocx files live. When ccleaner starts, it will find this ccleaner.exe.manifest file and not look in the registry to see where ccleaner's .dll and .ocx files live.

Another useful tool I found lists all the dlls loaded while a program is running. It's similar to Process Explorer but I'm a collector of tools and thought I'd share it here. http://www.sysinternals.com/utilities/listdlls.html

My problem is that I have not been able to use the DLL/COM redirection for ccleaner.exe on my Windows 2000 laptop.

Here's the scoop:

I found various articles on the above methods:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sbscs/s...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc...

http://blogs.msdn.com/junfeng/default.aspx

There are many more articles...check google if you want to find more.

So the DLL/COM redirection method says to create a ccleaner.exe.local file in my ccleaner directory. All my .dll and .ocx files live in this directory so according to the articles, when ccleaner starts, it should see my local file and use my .dll and .ocx files. Unfortunately this is not happening and I get a CCLISTBAR run-time error.

Any ideas on why this doesn't work in Windows 2000? If this was to work, this would be useful to keeping your apps portable and not messing up the registry!

If you do try either method, I'd really like to hear what applications work and which don't.

Ashes for Tears
Offline
Last seen: 17 years 1 month ago
Joined: 2006-01-11 08:41
Wow, great find! I shall

Wow, great find! I shall test this and report back in a bit. Smile Thanks!

Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
Now I'm stumped...

I just tried creating the manifest file on another Windows XP Pro computer, and this time it came up with an error! What the... My XP Pro at work creates it fine, yet a similar XP Pro desktop does not...I've got to verify this when I get to work on Monday. Hopefully someone else can get this to work consistently!

Ashes for Tears
Offline
Last seen: 17 years 1 month ago
Joined: 2006-01-11 08:41
Gotta love tech . I'll test

Gotta love tech :). I'll test it on the XP Home and the Pro. (Since it isn't quite such a big deal with me Da as WB, he should be fine with it.)

Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
Just to clarify

When I said earlier that it didn't work for me on another Windows XP PC, I meant that the tregman tool did not work for me. When I used the manifest file I created using tregman on my work PC on the other Windows XP PC, then the redirection worked and ccleaner opened with no errors. So it would seem that side-by-side assembly works for the two windows XP PC's I have access too. I'll have to look into writing a script to generate the manifest file instead of relying on tregman.

famewolf
Offline
Last seen: 14 years 10 months ago
Joined: 2006-04-27 12:45
ccleaner.exe.manifest

Can you post the ccleaner.exe.manifest? I'm trying to make ccleaner portable on my usb stick.

Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
Here you are

From my experience this only worked for me on Windows XP machines.

...okay, so it's written in xml and when I try to copy it here nothing shows up? I've tried using the code tags, but then my code is ignored and all that is displayed is an empty box...any ideas how I can show this code?

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
HMM....

Did we forget something???

***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.

Deuce
Portable Software: Just the beginning.

Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
It's not pretty, but try this then...

Since no one has got back to me on how to post xml code, here is my work around:

Replace all ~ with less than symbol
Replace all ` with greater than symbol

Save the file as ccleaner.exe.manifest in the same directory as your ccleaner executable and .dll/.ocx files. I believe this only works for the Windows XP operating system.

I hope you find this useful.

~?xml version="1.0" encoding="UTF-8" standalone="yes"?`
~assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"`
~file name="cchelper.ocx"`
~comClass description="CCHelper"
clsid="{990D6ADB-614A-4BE3-BDCC-F438BFAB03BB}"
progid="CCHelper.CommonClass"
threadingModel="apartment" /`
~comClass description="CCHelper"
clsid="{97578E6D-671B-4FDB-BE8A-8BA4E202508E}"
progid="CCHelper.UniLabel"
threadingModel="apartment" /`
~comClass description="CCHelper"
clsid="{D0B1BB45-74F9-41C8-99B9-5FB19B864CCE}"
progid="CCHelper.HighButton"
threadingModel="apartment" /`
~/file`~file name="cclistbar.ocx"`
~comClass description="CCListBar"
clsid="{4813D02C-2D62-418E-A62D-46DB093202CF}"
progid="CCListBar.ListBar"
threadingModel="apartment" /`
~/file`~file name="cclistview.ocx"`
~comClass description="CCListViewControl"
clsid="{16F2BD88-1F70-4D0F-94E0-3BC04427774C}"
progid="CCListView.CCListViewControl"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{FE097604-C07B-4AF0-86FB-F54A741A7BFE}"
progid="CCListView.cListItem"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{1E928015-E1FE-46B1-86F8-446A6B0A68C1}"
progid="CCListView.cListItems"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{8AD6C8A0-2E40-4E62-AE23-52672AA4CEF5}"
progid="CCListView.cColumns"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{F0ED4C2D-C853-48D1-8DF7-74301C3342A6}"
progid="CCListView.cColumn"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{236EC796-ECFE-4A93-AB3E-212D04D7E491}"
progid="CCListView.cItemGroups"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{78A1CD10-DCC2-4ECA-8F65-CF0A6EBC57A9}"
progid="CCListView.cItemGroup"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{2861134B-CD4D-43FE-80FA-43CCD1C482AB}"
progid="CCListView.pcItemGroup"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{3281F281-B827-4019-B5C8-A5E73A78A086}"
progid="CCListView.cSubItem"
threadingModel="apartment" /`
~comClass description="CCListViewControl"
clsid="{F31B513D-2645-4B2D-8B21-5110A835415F}"
progid="CCListView.cSubItems"
threadingModel="apartment" /`
~/file`~file name="cctab.ocx"`
~comClass description="CCTab"
clsid="{9C6487A8-2DC6-414E-A917-CFD4EA03A94B}"
progid="CCTab.TabControl"
threadingModel="apartment" /`
~/file`~file name="cctreeview.ocx"`
~comClass description="CCTreeView"
clsid="{B171AC80-E642-441F-8FBB-46E1181779A9}"
progid="CCTreeView.CCTreeViewControl"
threadingModel="apartment" /`
~comClass description="CCTreeView"
clsid="{B263802E-DC3E-4B7F-8ED8-4433FD638BCA}"
progid="CCTreeView.cTreeViewNodes"
threadingModel="apartment" /`
~comClass description="CCTreeView"
clsid="{C78BFA3D-688D-4F60-AC8C-765E9A45615A}"
progid="CCTreeView.cTreeViewNode"
threadingModel="apartment" /`
~/file`~file name="ccsubtimer.dll"`
~comClass description="CCleaner Subclassing and Timer Assistant"
clsid="{BFE89110-18C5-4537-AC21-BE14F8C9CE47}"
progid="CCSubTimer.GSubclass"
threadingModel="apartment" /`
~comClass description="CCleaner Subclassing and Timer Assistant"
clsid="{6C937E2D-802F-4E41-A3B2-9AE023812943}"
progid="CCSubTimer.ISubclass"
threadingModel="apartment" /`
~comClass description="CCleaner Subclassing and Timer Assistant"
clsid="{D96DCFF2-AF64-4156-81E3-5C892A643BB1}"
progid="CCSubTimer.CTimer"
threadingModel="apartment" /`
~/file`~file name="ccsystem.dll"`
~comClass description=""
clsid="{79D883AF-80AE-4D2B-9238-9AEE0ACB33CE}"
progid="CCSystem.cCommonDialog"
threadingModel="apartment" /`
~comClass description=""
clsid="{B4349FC3-AE6C-4D11-AB07-BE1DB37C0ED1}"
progid="CCSystem.cBrowseForFolder"
threadingModel="apartment" /`
~/file`~/assembly`
famewolf
Offline
Last seen: 14 years 10 months ago
Joined: 2006-04-27 12:45
xp vs 2000

Well..I saved it...and doesn't appear to work under win 2000...will have to stick to the bat file that registers/unregisters the dll's etc.

Thanks for trying.

Greavette
Offline
Last seen: 8 years 2 months ago
Joined: 2006-01-12 21:12
An app.manifest file will not work with Windows 2000

Hi Famewolf,

Using the manifest file is called side-by-side assembly, and this only works in Windows XP. Windows 2000 uses DLL/COM redirection but I couldn't get this to work on my Windows 2000 PC.

Like you said, the .bat file solution will work.

I haven't had time to look into this all that much, but maybe AppShadow is something you can use???

http://www.d-fens.net/?uToc=1&idMenu=3&idSub=9&idPage=1&uLinkPages=1&uToc=0

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-06 21:27
*Cleanup in node

*Cleanup in node 1056*
----
R McCue

"If you're not part of the solution, you're part of the precipitate."

Topic locked