Silverfrost Forums

Welcome to our forums

How to make the compiled .exe file portable?

15 Dec 2011 7:22 #9380

When I compile my program and run it, it runs fine. But when I copy that .exe file to another computer, I get various errors complaining about missing files.

Is there a way to compile my program so that the 'missing' files are somehow included, and the program can run on another computer?

15 Dec 2011 9:00 #9381

Assuming you compiled in Win32 mode, the other file you need is Salflibc.dll Whether or not you need anything else, depends on options you made: special fonts, other dll files etc. Although an EXE will run with Salflibc.dll in the same directory (folder) as the EXE, the conventional place to put it is in \windows\system32. Then you only need one copy for however many EXEs you have dotted around in separate folders. Just copying the EXE and Salflibc.dll is simple enough, but if you want shortcuts on the desktop or in the Start Menu, then a slightly more elaborate procedure is required. This is to create a self-installing package. I, and several others here, use a freeware program from Jordan Russell Software called InnoSetup. Using this, you first write a “script” that details all the things you want to set up when you install your program on a new computer. Innosetup then creates a single new EXE file containing in a compressed form all your files, including your EXE and Salflibc.dll. When you run that new EXE file it puts all the parts of your application in the right places, and adds the shortcuts, file associations etc. You can also install help files etc. One of the really big advantages of InnoSetup is that it creates a single install file, and because it is compressed, it is smaller than the sum of the files that make it up! On the other hand, it is 99% probable that all you need is Salflibc.dll. Eddie

25 Jan 2012 9:01 #9495

Thank you, Eddie! I'll give it a try.

Please login to reply.