Solved

How to compile an "independent" application

Posted on 2002-03-27
6
347 Views
Last Modified: 2013-11-14
Hello.

I would like to compile and deploy an application in a perhaps less usual way, namely that the program can be run “straight away”, that is without having to install it first – so that for instance, the user can run it from a CD-rom.

I have already found out that when I compile my application, the resulting EXE will look for all kinds of necessary .dll’s, .ocx’s and what not, and that it expects them to “reside” in the directories where they where when the EXE was created.

When one creates a setup.exe package using the package and deployment wizard or independent programs such as InstallShield or Wise, those .dll’s, .ocx’s will apparently be included and when the user installs the program, they are being placed in the corresponding “default directories”.

In order to run completely independent, those files would have to be located in a directory where I want them to be and the compiler should be told to produce an EXE that looks for them there.

1) Is it possible to achieve this and how do I go about it ?
2) Does Visual Basic or Visual Studio include a compiler that can achieve this , or can InstallShield and WISE ?

Many thanks,

Michel
0
Comment
Question by:michelvanpassel
  • 3
  • 2
6 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
Comment Utility
It is possible, the most popular tool for this is the Fusion product from http://www.bit-arts.com/fusion which will combine all the runtime files and any necessary dlls/ocxs into a single executable. This also handles the dynamic extraction of any necessary dlls/ocxs etc when you run the application.

Unless you use this or another similar tool you cannot do this with any of the installation package tools.

The only other method is to include all the necessary dlls/ocxs in the same folder on the CD as your application, whilst normally the application will look for dlls/ocxs in \windows\system32 or equivalent or any other specified installation location it will also check the startup folder of the application so including everything in this folder is a possible method. However it is not necessarily entirely reliable especially if there are conflicting versions of dlls/ocxs installed already on the machine that it will be run on.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
Actually,FUSION is somewhat "misleading" as it is actually a SELF-INSTALL program, which does the install, under the covers, and then executes the "main" app.

In reality, it is IMPOSSIBLE to totally avoid some form of installation, whether it is EXPLICIT - the user MUST install the program forst, and then run it, or IMPLICIT- such as Fusion, which installs the support strcuture and the executes, without the user being involved directly in the installation step.  Either way, the support DLLs, which a VB program MUST have in order to operate, MUST be installed, with the necessary registry entries made, for the application to run.  That is the nature of the way VB 6  earlier programs are structured.  That WILL not be the case with VB.NET which DOES NOT require an EXPLICIT installation, and does not use the regitry the way COM does.  In fact, with .NET, after the CLR has been "installed" on a system, then "installation" of a .NET application can be accomplished with a simple XCOPY of the >EXE to the target PC.
0
 

Author Comment

by:michelvanpassel
Comment Utility
Hello Tim,
Hello Arthur,
Thanks for your comments. My apologies for this very late reply, but I have been ‘out of computer circulation' for almost two months.
As Arthur states, some files have to be installed for any program to work.
So what I'm going to try is this:
-     Create a setup that will ask to install all necessary files in a specified location.
-     When running this setup, tell it to install the package on my CD-RW drive (which can be done if the right software has been installed).
-     Then ‘eject' (or ‘finalise' as it is sometimes called I think) the CD.
This should produce a CD with an installed and ready to use version of the program.
And as Tim suggests and after visiting the Bit-Arts site, the Fusion program could do the trick.
If I succeed, I will surely let you know.
Finally, as Arthur says, this won't be a problem anymore with .NET - but I'm not up to that yet.
I would like to award both of you the 200 points. I'll start with Tim and try the same for Arthur, but don't shoot me if it doesn't work.
Thanks again,
Michel
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:michelvanpassel
Comment Utility
Hi Arthur,

As I feared, once the anwer accepted, I can't award any more points for this question.

I owe you one.

Michel
0
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
Michel if you want to award Arthur some points you can always raise a dummy question pointing to this one of the for "points for arthur_wood" body of the URL to this question.
0
 

Author Comment

by:michelvanpassel
Comment Utility
Thanks Tim
I'll do that, because EVERY usefull advice is worth points.
Greetigs
Michel
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now