You are here

How to make a PortableApp, my version

18 posts / 0 new
Last post
gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
How to make a PortableApp, my version

With the new installer, AppCompactor, and menu... we've been getting a lot of people willing to take their time and make PortableApps for the site. As I already know, OliverK made another "Making a PortableApp Guerilla field" or something like that. However, I think it's also a little confusing. I didn't understand any of it and had to had Kevin Porter translate it into human for me when I got here almost a year ago. So I'll be targeting this at somebody with no technology background.

To start, I think the most important thing is to understand there is no easy way out to making a Portable App. You need to put time and effort into this and sit down to read the NSIS manual (programming language we use to make launchers).

A launcher is what the developers here make when designing the Portable App. Launchers are made from codes and commands to do what the user wants. A.K.A. a basic program. So in short a launcher is another program running on top of another, managing it's settings. But we'll get into that later.

First, let's understand what they're made of. Like I said before launchers are made from codes and commands typed in from the user/programmer. All that text is put into a AppNamePortable.nsi file (AppName being your app you want portable) in the Source folder. .nsi stands for "Nullsoft Installer" and NSIS for "Nullsoft Scriptible Install System". NSIS is the name of the programming language. NSI is just a short version of it and a file extention to tell the Opperating System that THIS IS A NSIS FILE!!! NSIS files (or .nsi files) are later compiled turned into .exe (executables) with a file (comes with NSIS) makensis.exe . The definition of a compiler is something used to turn something a human can read to something the computer can read. For security reasons and unstable, this process cannot work the other way around. But there are some exceptions. For example, AutoHotKey and AutoIT has a uncompile feature, but need a password from the original creator. One thing I was confused about was that NSIS is for installers, but John found a way to use it for our launchers too.

Another important thing to understand is how launchers are doing their jobs. In summary, once they're launched, they move all AppName's settings to someplace else, then import (from the Data folder) it's own into wherever it should be or where the original settings were. AppNamePortable.exe hangs around hiding in the background until it detects that AppName.exe quits. Then it exports all the settings into the Data folder and moves the original settings back. Of couse, leaving as close to nothing as it can on the computer.

Think of the AppCompactor and PortableApps.com Installer as tools to polish and dust off the program (AppNamePortable.exe) you made. You don't need them to make the programs. However, we'll get into what you do need later.

The AppCompactor just make the files smaller, and gets rid of unneeded stuff in the folders. You should compress as much as you can. Usually it only makes it about a litte less than a meg smaller. But that depends on the program you're portablizing and what programming language it's built in. You should generally only compress the App\AppName folder, why? Because the AppNamePortable.exe can't be compressed. (If a NSIS program/installer is compressed, it'll break the program.)

The PortableApps.com Installer puts your app into that nice package, after you've finished eveything (compressed, compiled, etc). So all it does is just put your program in a box, to sail off to PortableApps.com Land.

We're ready to start the programming. Here's some tools you'll be needing. (I've linked to the Portable Versions, but you can also get the local versions).

  • Eclipse - Editor (Requires java, so it'll take up about 250 MB, if you can't fit that, go for HM NIS. I really recommend this it it's 10 times better than HM NIS if you get it working.)
  • HMNIS Edit - Editor
  • IcoFX - Icon editor, you'll need this for the appicon.ico in App\AppInfo
  • NSIS - Compiler
  • RegShot - Finds out where SOME of the settings of AppName are stored.
  • winMD5Sum - Checks the MD5 for your programs
  • AppCompactor - Compresses your program
  • PortableApps.com Installer - Puts it in a box to ship to PortableApps.com Land

Now that we have all the files and utilties we need, let's start understanding the paf format. PAF stands for PortableApps.com Format, and what it is exactly is how the folders in our programs and information is managed through the package. More information on it is over here...

Download this file over here... it's a template and a finished paf format. All you have to do is update everything for your app and finish the launcher. Rename everything in there with AppName to the name of your application. (ex: rename AppNamePortable to FirefoxPortable, App\AppName to App\Firefox, an so on). We'll get into renaming inside the files in the next step.

(Still in work)

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
Sorry guys...

Sorry guys...

Either I reached the limit to how much the DSi can type in one textarea or I've reached the drupal limit.

YES! I typed all that on the DSi!!! Got a problem with that?

I was going to say that there were some execeptions to uncompiling because AutoIT and AutoHotKey have decompile features but require a password.

NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-07-31 15:07
DSi, not limit

You didn't hit the Drupal limit. Pretty sure there is one, but I know I've written longer posts than that and they've sailed through the post parser without a warning on post length. I'm not sure where it is.

DSi huh? I had an R4-modified DS Lite last year, and I wrote some pretty long short stories on it using DSOrganize's text editor. The files came out at about 25KB, on average. That program was just broken, though. You'd be typing and it would just quit to the file manager without saving. I think the guy, DragonMinded or something, stole the code from a roommate, got him drunk and stole his stuff or something. Because people started calling him on the bugs and, rather than fix it or say he was going to fix it, he pulled all his contact information and replaced it with stuff like "you can't contact me, I don't want to talk to you!". And that was the BEST way to write on the DS Lite. Well, that and "save often".

Anyway, the browser for the DS Lite was trash, but the DSi is supposed to have more memory, so I guess it works better. Heck, the DS Lite's browser couldn't even post on GameFAQs' forum, that board to which 1996 constantly calls asking for last year's cutting-edge forum technology back... so yeah, if the browser couldn't handle the 1995 Internet, how could it handle the rest of the web, today?

In any case, your post was helpful, but Chris is right, he's built a better mousetrap, as it were, and the NSIS launchers may soon go the way of the dodo. And just about anyone can configure a .INI file. I started one for something (NetHack - an open source game, you've probably heard of it) but I started getting a headache from it. Plus I really need RegShot, maybe a couple other apps (which I do, or should, have) to get it right.

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
Yeah, it's the DSi limit. It

Yeah, it's the DSi limit.

It looked a like a lot more text on the DSi browser.

And the DSi browser is supported by Nintendo, so yeah, it's a lot better than that R4 one.

NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-07-31 15:07
Still Opera?

Is the DSi browser still the re-branded Opera browser? Because that's what I was referring to, the "Nintendo DS Browser", and that was supported by Nintendo as well - just not for very long, I don't think. It came with a memory module that plugged into the GBA port, 8MB I think. I later got a device that had 16MB RAM and did other stuff, like rumble as well. The web browser in the R4 wasn't worth using; I certainly didn't mean that. I don't even think it supported graphics. Your DSi hasn't got a GBA slot, but it's got more power under the hood to make up the difference and then some. Having not used a DSi, I get the impression it's closer in capability to the PSP when it comes to browsing the web.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Don't worry

Really, don't worry about it. For starters, your thing really doesn't explain what needs doing as well as Oliver's one does (even if it does include descriptions of why launchers etc. which can be useful).

More to the point though NSIS launchers are due to be obsolete within a few weeks.

Smile

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

steve_gutry
Offline
Last seen: 4 months 3 weeks ago
Joined: 2008-05-07 16:54
Sounds Great!

Will it be similar to JauntePE with its universal ini file & special redirection directories?

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
??? What? What do you mean

???

What?

What do you mean NSIS launchers are obsolete in a few weeks?

qwertymodo
qwertymodo's picture
Offline
Last seen: 11 years 8 months ago
Joined: 2008-03-17 19:08
I take it he's referring to

I take it he's referring to his universal app launcher that you just drop the precompiled launcher in and just configure an INI file and it takes care of everything for you, no coding involved. I guess he's been working with John and by saying it'll be a few weeks, I'm guessing that's how long it'll be until it goes official.

Quamquam omniam nescio, nec nihil scio.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Basing it from what John says

in a couple of threads, e.g. in the Monster 2 one.

I'm just sorting out the joint copyright assignment thing, then we'll be properly pooling.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

horusofoz
horusofoz's picture
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-04-03 22:45
Can you elaborate

Can you elaborate on the joint copyright thing?

PortableApps.com Advocate

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Two copyright owners

It's just an agreement saying that we both own copyright ownership on it (i.e. I give Rare Ideas LLC copyright ownership with me on what I've done, then we work on it together).

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
... Then what will happen to

...

Then what will happen to the developers? Sad

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
More useful

They'll be able to do even more useful and efficient work, configuring INI files quickly rather than slow and painful work on NSIS launchers Smile Really, I speak from experience: I spend a few hours whittling an NSIS launcher in to shape, or I spend about 73.6 seconds (± 17.3 seconds) writing INI code.

I've sent the joint copyright assignment form back now, so we should be moving forward tomorrow Smile

Just as an incidental note now that you've started adding content to the page, I'll take my own gVim Portable over EclipseNSIS or HM NIS Edit any day. I'd choose Notepad++ over HM NIS Edit as well, except in the area of InstallOptions pages (custom GUI pages).

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
But that ruins ALL the fun

But that ruins ALL the fun Sad

And I really don't like gVim that much, no line numbering, compile from editor, or other features I liked.

SilentWalker
Offline
Last seen: 13 years 9 months ago
Joined: 2008-11-06 12:23
Does that mean

Does that mean that we'll get updated apps more quickly? Wow Chris, your new launcher look really promising!

gluxon
gluxon's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2008-06-21 19:26
:( Not for me :(

Sad

Not for me Sad

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
:set nu

Line numbering Smile

And also investigate compiling: it's there. And also all those other features you like. They're there.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Log in or register to post comments