Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I want to make an application portable (on Windows XP), so that it can run directly from a CD. The application requires some DLLs and OCXs to be registered, and some of these need to be in system32 when registered (for some reason).

What are the consequences of registering a lot of DLLs with regsvr32 in a wrapper program/script around the application? Could this mess up a system? And what happens when the files are removed (since they are on a removable media)?. I guess I could unregister them again when the portable application is stopped, but what if one of them is a common DLL which is also used by other applications? Would unregistering it break those other applications?

I assume that copying files randomly to system32 when staring a portable application is a bad idea. Why would an application require that some DLLs and OCXs are in the System32-folder? Is there a way to work around it? Is the only way to make the wrapper program/script make sure that none of the files already exist before copying, and remove them after running the application?

Has the way these things work changed in Windows Vista and 7?

The application I want to make portable is the demo version of the (Norwegian) genealogy application Embla Familie og Slekt (Norwegian website, translated by Google). My grandfather, who did a lot of genealogy work, passed away recently, so I would like to distribute his work to my relatives. It would be great if all they had to do was insert a CD, and the software would pop up. Installing it and setting it up to use my grandfather's data is a bit complicated for a novice computer user. (I have tried to contact the authors without success, but I will try again if I get it to work, to make sure that distributing the demo is legal)

Thank you, and please forgive my ignorance - I usually don't run Windows. :)

share|improve this question
i suppose VMWare's ThinApp is a bit of an overkill situation, given the price tag on the sunny side of $6.000 :) – Molly7244 Nov 22 '09 at 18:39
I believe that is a good resource for portable application development. This question doesn't seem to be very advanced, so you may find your answer there. – alfplayer Nov 25 '09 at 22:33
up vote 1 down vote accepted

I don't know why the DLL's would have to be in System32; they shouldn't have to be, it is bad practice to but application DLL's in the systems' directory.

Yes, DLL's and OCX's that expose COM object (e.g. those that need to be registered), do need to be registered and listed in the registry. However, with Windows XP and later there is registration free COM. The short explanation is that for each .DLL and .EXE you create a filename.ext.manifest file that lists all the components that it exports and uses. Unfortunately reality is more complex. See this article for a description. It is theoretically possible to come up with the information you need for the manifest files, but you will need a good understanding of COM.

share|improve this answer
Thank you. This answers much of my question. The way I solved my problem, though, was to install the software inside Sandboxie (, and then make Sandboxie portable. Note, however, that the Sandboxie licence agreement doesn't allow you to distribute Sandboxie to other computers without a commercial licence or special permission from the author. – user18913 Jan 26 '10 at 18:16

Many years ago, I understood that when Windows needed a dll file that wasn't registered, it automatically looked in the directory of the exe file. In such a world, making the application portable is very easy.

I have no idea if I am remembering this right (or even more or less right) or whether or not it is still the case, but copying all the files to a USB stick and putting it in another computer would be a fairly quick and easy check.

share|improve this answer
Thank you for your suggestion. Unfortunately this doesn't seem to work. I did the install in Sandboxie, so I have been able to test many similar things in different Sandboxie-sandboxes. For it to work, it appears that all DLLs need to be registered (even though they are in the same folder as the exe), and some of them need to be in the system32-folder (it doesn't work if I register them when they are anywhere else). I will give your tip a try on a clean computer tomorrow, though. Maybe the Sandboxie-stuff has messed something up somehow. :) – user18913 Nov 22 '09 at 16:41

You must log in to answer this question.