Newbie deployment question

tcross

Member
Joined
Oct 26, 2006
Messages
10
Programming Experience
1-3
I am figuring out how to deploy VB applications to computers in which the .net package is not installed. Reading through the threads it looks to me like these are my choices:

1. Download and Install the .net framework package (dotnetfx.exe). I did this and it works.

2. Buy the Xenocode.

3. Figure out how to use the OneClick software and run it on a server.


Is there any other choice? Won't VB.net construct an .exe which includes all the necessary files? Have I overlooked something obvious?

Thanks.
 
Visual Studio does compile an exe that has all the necessary files, but that means necessary for the application to run in the .NET environment.

There is another thread in which one of the senior members here mentioned an app that could complile your exe's to machine code, but the price range for that ability seemed rediculous in respect to just installing the Framework.
 
There's very little to figure out about ClickOnce publishing if your app is simple, plus you don't run ClickOnce apps any differently to other apps. If you run a ClickOnce installer on a machine with the Framework installed it will install the Framework, then install the application right there on the local machine. It is installed to different location than normal, which is how the Framework is able to mange the features that ClickOnce provides, but to the user it bahves exactly like any other application.

The non-Express versions of the IDE also support Windows Installer Setup projects, which lack some of the ease-of-use features of ClickOnce but add other features of there own. If you're using VB Express and you want a Windows Installer package then you'll have to use a third-party tool to create it. There are freebies available, like Inno and NSIS, but they aren't quite as user-friendly as the commercial packages like InstallShield, etc.
 
There's very little to figure out about ClickOnce publishing ...
It is installed to different location than normal, which is how the Framework is able to mange the features that ClickOnce provides, but to the user it bahves exactly like any other application.

??? What location is it actually installed in ??? I'm asking because my app uses supporting files that must reside in the same directory, and I can't seem to find the installed pgm (vs2005 Express).
 
??? What location is it actually installed in ??? I'm asking because my app uses supporting files that must reside in the same directory, and I can't seem to find the installed pgm (vs2005 Express).
Why does it matter where it's installed? If you have supporting files then just include them in the installation package and they will be installed to the same location. Where that location actually is doesn't matter, or at least it certainly shouldn't. No matter whether you use ClickOnce or not you should NEVER be hard-coding a path in your app. You should ALWAYS either have the user specify a path at run time or else use expressions that get a path from the system, e.g. Application.StartupPath, Environment.GetFolderPath and My.Computer.FileSystem.SpecialDirectories.
 
I'm not sure how to include text & data files with the installation package. What I see in "Add Reference" is only for .dll, .tlb, .olb, .ocx, .exe & .manifest files.
Also, if I want to put a short cut on the desktop, I'll probably need to know where the app. is... Yes? :confused:
 
Last edited:
To include data files with an application you add them to the project through the Solution Explorer the same way you add forms, classes, etc. When you've added the file of the desired type you need to select it in the Solution Explorer and open the Properties window. Make sure the Build Action is set to Content, which it should be by default, and Copy To Output Directory is set to Copy Always or Copy If Newer, which it won't be by default. If you then go to the Publish page of the project properties and open the Application Files dialogue you should see your file include in the set to publish.

As for adding a shortcut, the Publish Wizard should take care of that for you.
 
--- I don't think that the Express edition allows you to create a short-cut. 'Guess I'll just try to find a way around that cause I can't spring the $200 bucks for the real vs.NET package yet. Times are tight.
...Thanx, JM ;)
 
Last edited:
--- I don't think that the Express edition allows you to create a short-cut. 'Guess I'll just try to find a way around that cause I can't spring the $200 bucks for the real vs.NET package yet. Times are tight.
...Thanx, JM ;)
I don't think it has anything to do with VB Express. I don't use ClickOnce so I'm not sure but it may just be that ClickOnce will create Start Menu shortcuts but not desktop shortcuts. I might test it out on a virtual machine.
 
ClickOnce offline installation only creates a start menu shortcut (application reference actually), user can copy/shortcut this to desktop or other places. In VS 2008 SP1 (also for Express) there is added option to also create desktop shortcut with ClickOnce deployment (Options, Manifests).
 
OK, I know this thread is way off base from where it started from... but this is eating at me. I beg your patience while I beat this into the ground. I will need to be able to get to the data files that are associated with my application after they are out in the field... possibly from applications that have not been written yet and for technical support or updates or whatever may come up. It won't be possible if they are hidden deep inside the .NET world and invisible to something like Windows Explorer. Before I put so much time into creating this app, I just assumed it would be placed in ?:\ + "Program Files". I suppose I could be a man and just cough up the $ for vb.NET (non-Express) or a 3rd party installer, but please let me run by my last futile attempt at doing this on the cheap. What would be wrong with just copying my .exe program file from "Visual Studio 2005 \Projects\ ProgramNamexxx\ bin" along with all of my associated files; making sure that the framework is installed; creating my desktop and start menu shortcuts; and never actually installing the program. I really don't care if it shows up on the list of "Installed Programs". I guess I would need my own "Uninstall" operation as part of the main program... I know this sounds ridiculous, and I expect to be ripped a new one for suggesting this.... so...
 
OK, I know this thread is way off base from where it started from... but this is eating at me. I beg your patience while I beat this into the ground. I will need to be able to get to the data files that are associated with my application after they are out in the field... possibly from applications that have not been written yet and for technical support or updates or whatever may come up. It won't be possible if they are hidden deep inside the .NET world and invisible to something like Windows Explorer. Before I put so much time into creating this app, I just assumed it would be placed in ?:\ + "Program Files". I suppose I could be a man and just cough up the $ for vb.NET (non-Express) or a 3rd party installer, but please let me run by my last futile attempt at doing this on the cheap. What would be wrong with just copying my .exe program file from "Visual Studio 2005 \Projects\ ProgramNamexxx\ bin" along with all of my associated files; making sure that the framework is installed; creating my desktop and start menu shortcuts; and never actually installing the program. I really don't care if it shows up on the list of "Installed Programs". I guess I would need my own "Uninstall" operation as part of the main program... I know this sounds ridiculous, and I expect to be ripped a new one for suggesting this.... so...
ClickOnce apps are installed to the ClickOnce cache, plain and simple. ClickOnce isn't suitable for all scenarios and, if you find yourself in one of those scenarios, you can't use ClickOnce. If you have a full edition of VS then you have the option of using Windows Installer through a Setup project. Even then there are limitations though, so not everyone uses them. No matter the VS edition you use, you always have the option of using a third-party tool for deployment. There are free options, like Inno and NSIS. They can be very powerful, although they may not be as user-friendly as some commercial options.

That said, maybe you should consider storing your files under the Application Data folder instead of the program folder. That way they are in a specific location that is accessible to your app and any other app or user too. You say that your files MUST be in the same folder as the EXE but that's simply not true. The only files that MUST be in the same folder as the EXE are the config files and referenced DLLs, and you can even put DLLs elsewhere if you want to. You just have to write your code to access the files in the appropriate location.
 
Yes, the word "MUST" was inappropriate. This is very helpful stuff. I will look into "Inno" and "NSIS". Thanks for the help JM.
 
Back
Top