How to Write an Executable File for a Piece of Software

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Hello,

I don't know if executable is the right word for it. What I want to do is take software I've just written and be able to formally download it so that it is installed like all the other "real" programs I have.

Right now, my program exists as a bunch of text files that I gave the .java extension in a folder on my desktop.

I want to put my program in a downloadable form so that I can give it to other people and have them run it on their machines (as long as they have Java run-time environment). Most importantly, I want to do this in such a way that the source code is hidden (again, just like in "real" programs.)

Thanks for your help.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
You're talking about writing an installer. I don't have much experience with installers for Java programs. Writing installers for Windows applications pretty much sucks whatever they are written in. It's been about three years since I had to do it, and at that time the best you could do was a project called Wix, which layers an XML definition format on top of Windows Installer. It's horrible, but mostly because Windows Installer is horrible.

If your program doesn't have external dependencies to be checked, hardware requirements, drivers, etc., then I would just package it as a .zip that will run in any folder it's extracted to. That's the simplest thing to do in the beginning.
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
You're talking about writing an installer. I don't have much experience with installers for Java programs. Writing installers for Windows applications pretty much sucks whatever they are written in. It's been about three years since I had to do it, and at that time the best you could do was a project called Wix, which layers an XML definition format on top of Windows Installer. It's horrible, but mostly because Windows Installer is horrible.

If your program doesn't have external dependencies to be checked, hardware requirements, drivers, etc., then I would just package it as a .zip that will run in any folder it's extracted to. That's the simplest thing to do in the beginning.

An installer.....yes, that's what I mean. When you download a program online, an installer comes with the program, right?

Why do you need an installer? Why can't a computer handle the program directly?

What does it mean for a program to be installed? I know what the consequences are - the program shows up on your control panel (in windows), you can give it a GUI clickable shortcut, etc.

But, on a deeper software / hardware level, how is an installed program different than one that isn't installed like mine for example?

Are installed programs stored on some special area of the HD?

Thanks.
 

ninaholic37

Golden Member
Apr 13, 2012
1,883
31
91

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Why do you need an installer? Why can't a computer handle the program directly?

Depends on the program. At one end of the spectrum is something like a simple text editor. All the assets it needs come with the program and get installed into one directory. You double click the exe to start it, and if you don't want it any more you just delete the folder.

At the other end is something like a photo or video editor, or a multimedia application. Maybe it needs to be sure certain base libraries are installed, or it needs to install a driver, or the author wants the icon to get copied to the desktop, and an entry created in the Control Panel -> Programs and Features applet. Stuff like that requires not just copying stuff into a folder, but actually executing code at install time to make certain changes.
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Depends on the program. At one end of the spectrum is something like a simple text editor. All the assets it needs come with the program and get installed into one directory. You double click the exe to start it, and if you don't want it any more you just delete the folder.

At the other end is something like a photo or video editor, or a multimedia application. Maybe it needs to be sure certain base libraries are installed, or it needs to install a driver, or the author wants the icon to get copied to the desktop, and an entry created in the Control Panel -> Programs and Features applet. Stuff like that requires not just copying stuff into a folder, but actually executing code at install time to make certain changes.

I see. The installer makes sure that the program has the right environment in which to run.

My program is very simple compared to those big programs you mentioned. I think all I need is an execution file for my program.
 

KWiklund

Member
Oct 30, 2013
35
0
16
I see. The installer makes sure that the program has the right environment in which to run.

More than that, it's also helpful for end users. Your target users may not be adept enough to handle even unzipping on their own, much less ensuring other dependencies are correctly installed, icons created, etc. Being able to bundle all of these actions into one executable will save your customers a lot of frustration, and save you a lot of support calls.

At my office, we currently use Install Creator Pro, although there are a variety of tools that fit this role. IIRC, there is one that comes bundled with Visual Studio.