How do I create a portable app (runs without installing)
Asked Answered
E

4

8

How do I create an app that is:

  • lightweight: I am guessing don't require .NET frameworks maybe?
  • portable: runs without installing and saves data in the app directory, so i can just move the folder or maybe even the exe?

this is just a personal experiment: i want to try create a simple todo list app that has the above attributes

I am thinking:

  • C#/WPF (but requires .NET framework, I can explore client profile thogh)
  • Appcelerator Titanium (i think this will be lightweight & good enough? I do not know if I can have a portable titanium app though)
Existentialism answered 30/5, 2010 at 1:56 Comment(0)
D
3

It is almost portable if the target machines have .NET Framework installed.

NDepend is such a product, which is built against .NET 2.0 and runs fine on Windows Vista, Windows 7, and other Windows if you manually install .NET 2.0 before.

Personally, it is not hard to write an application launcher in native languages such as C++/Delphi to detect whether the target machine has .NET. If .NET is not yet installed, this launcher can display a warning or help install the framework automatically. (Even some installers allow you to do this.)

Dipterous answered 30/5, 2010 at 2:56 Comment(0)
G
3

If you want to write it in C#, you either need the .NET framework or the Mono framework. Either way you need it. Thankfully .NET 2.0 is pretty ubiquitous.

By default, .NET uses xcopy deployment, so you can just copy the executable and any necessary DLLs around in a directory. It doesn't need to be "installed" unless you explicitly create external dependencies.

Guttural answered 30/5, 2010 at 2:14 Comment(0)
D
3

It is almost portable if the target machines have .NET Framework installed.

NDepend is such a product, which is built against .NET 2.0 and runs fine on Windows Vista, Windows 7, and other Windows if you manually install .NET 2.0 before.

Personally, it is not hard to write an application launcher in native languages such as C++/Delphi to detect whether the target machine has .NET. If .NET is not yet installed, this launcher can display a warning or help install the framework automatically. (Even some installers allow you to do this.)

Dipterous answered 30/5, 2010 at 2:56 Comment(0)
G
0

@jiewmeng, here i leave a few keys to build an portable application

  1. If the application need save additional data like configuration files o data files , must be saved to the same folder of the exe application or an child folder of the application.

  2. The application should not read/write configuration data to the Windows registry or in the %Appdata% folder.

  3. avoid the use of external dependencies like ocx o dll files, that need to register in the system.

  4. try to use an language wich makes native applications without framerworks dependence a good recomendation is use Delphi.

  5. If you want to use .Net language, choose a version of .Net framework, that is in common use in most of the systems like the Microsoft .Net 2.0

Girlish answered 30/5, 2010 at 2:20 Comment(0)
C
-3

Use Delphi, it's always portable and smaller

Claudetteclaudia answered 30/5, 2010 at 2:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.