How to make the application portable?

I have standard installations of some programs, and despite the fact that they are free, and I can download and install them on any machine, it's not so simple. When the system crashes and I don’t have a working machine or working Internet connection or a local map or drivers for the local map, I always try to find them and get them to work if any dependency file is not in this version of the windows.

I need to know how I can make applications portable so that I can run them from my usb or just copy them from my usb to my computer and run which applications for dependency files are required, and which files and where exactly the application is installed

+7
source share
3 answers

This is a complicated story, but I will try to summarize it. Starts with the Why?

I’m an obsessive guy who seriously hates installers. I like to have a clean system without bloated entries in files and DLLs. That's why I do almost all (at least 97%) of the programs that I use to carry. I have made over 600 to this day, and I can say:

You need: 1- A program to view the file system (which is included after installation) I use this. Simple and direct (sorry, but not free, but you can find many alternatives) http://www.samsunsegman.com/um/

2- A program for viewing the registry (what was changed or enabled after installation) I use this in HTML mode. Free fast and easy. And portable. http://sourceforge.net/projects/regshot/

Now scan the system with these 2, and then run the installer. After you open the installed program and configure as you want. And how to use this 2 program to search for added files and registry entries.

For files, delete them to remove garbage and return them from the recycle bin in batch mode (easy to do) to the application folder. Registry, open the related branches in the registry, delete all entries containing addresses, such as (plugins folder = c: \ prog .... etc.). After right-clicking on the main branch, select export. These are your reg settings ...

3- Download the program http://ctuser.net/?reg2exe This will convert your reg file to an exe file.

4- Download the application http://download.cnet.com/FilePacker/3000-2216_4-10414081.html Note. Click "Direct download link" if you do not want cnet to welcome you with its installer :)

And with this program (I use it because I don’t interfere with any application), pack the program that you want to make portable. In the wizard, first select the reg-exe file after the main program file. Launcher will execute them with this order. And in the setting, select "delete after terminate" to delete the extracted files on exit.

You can find out the details. This will help you port nearly 75% of simple applications.

5. For complex programs or complex needs, you can even make home loaders, for example

  • Before running the application, put the user files in the appdata folder (which I hate)
  • Put the settings in the registry (even with dynamically changed path addresses)
  • Choose which one to execute (x86 or x64)
  • Run as administrator if necessary
  • Running the application ... And when the application is completed ...
  • Delete settings from the registry
  • Return the user files from the appdata folder and put it back into the program folder (usb, etc.).
  • Delete files on the left in the system ...

I just wrote these last so that you understand how far you can go. And for all these extra tricks, I use simple and simple bat files. And I convert them to exe using this software. http://www.f2ko.de/programs.php?lang=en&pid=b2e (also free)

All software that I use, except for the "uninstall manager," is free. And with this technique, surprisingly, some of the programs work even faster.

You can actually just use JaunchPE tools or portable applications, but ... Jaunte programs and similar sandbox programs are so slow and incompatible with everyone. Even the cause of the failures. The handheld application approach is a little bloated regarding my rigorous standards and sizes. That's why I have been doing it myself for 10 years (yes, even people did not talk about portability)

Note. I am not a programmer, and you also do not need to do this. I have never released my portable devices, and you also should not (read EULA) to respect the authors.

But never forget to request a portable version from all authors. Make them quit the installers;)

Best wishes

+8
source

inovasyon did a great job! If you want to make some kind of portable application that will work on every computer on which you move it, then 99.9% of the applications can be made portable. If you also expect that the application will not leave any files, folders or registry entries behind and will not change or damage the settings on the main PC, this will slightly limit the situation. Applications that require administrator rights to write to protected areas of the registry or file system will be broken when used on a PC with locked privileges.

Applications that require installation on the host computer often leave them. You should know that there are applications that are locked for specific PCs. These are recent versions of Office for Microsoft - a great example. They simply will not start when switching to another computer. In addition, you will need some tools for creating a portable application: cameyo, thinapp, boxedapp, portableapps, spoon, app-v and others. Portable applications will be launched from a flash drive and from a computer. Good luck

+1
source

Here is an example of creating a portable application using PortableApps.com tools. They have a developer page, which is very useful for some features, but the general process is not very generalized. Here is a general outline of creating a portable application:

1. Examine the traces of your application

Find all the files, places in the registry and settings of the application that you want to make portable (use point (1) and (2) in inovasyon answer , and maybe take a look at Zsoft ). It is usually useful to start a virtual machine and track application changes without much interference.

2. PortableApp Generator

Download, extract and open PlatformApps.com Platform and follow [The system tray icon][Apps][Get More Apps][By Category] to install Launcher PortableApps.com and NSIS (Unicode), necessary for reconfiguring your application . Alternatively, but with some additional problems, download PortableApps.com Launcher and NSIS Portable (Unicode version) as standalone.
Now you can compile the project by launching Launcher PortableApps.com and pointing it to your project.

3. Layout and structure of PortableApp

Download the PortableApp.com application template (find it here ) to structure the data and files obtained in (1.) according to the specification. Also, download a few applications from portableapps.com for some practical examples of how they are structured and to learn more about portability issues like replacing drive letters in settings files according to moving portable drive).
As an example of "Hello World", try porting this simple program: helloworld.bat , with content:

  @echo off echo Hello World > log.txt 

It writes all local environment variables to the log.txt log file. You can play a little while trying to write files to the %APPDATA% subdirectory and see if you can make your project redirect it to a portable directory.

4. Additional use

If you need to do some extra encoding that is not reachable with the default .ini capabilities (for example, forcing only one instance of the application), add an NSIS script with the location of the App\AppInfo\Launcher\Custom.nsh to your project.
Note that the PortableApps.com user code guide does not correctly indicate the location of the file as Other\Source\Custom.nsh . It is also completely useless regarding the layout of this script. Get more examples from other applications and learn the syntax of NSIS using Google bits.

+1
source

All Articles