Installation of a C# .Net 2003 Application

R

Rob

I have an application written in C# 2003. The installation package for this
was done through .Net, and when it was installed on the target machine I see
it placed there not only the exe, but also the .cs and .resx files (from the
modules and forms used), as well as the .rpt files for the Crystal Reports
(v10) used by the application. My intention is to have the target directory
for the application only have the EXE file and run properly. I've seen
remarks about Installshield, when I tried that with a C# .Net install wizard
it did only install the exe, but erred out due to the missing .rpt (Crystal)
files. I've also seen something regarding an ILMerge utility, but am
unfamiliar with that.

With VB6 when you did an install, the exe would 'combine' any report files
into it. Is there any way to do this with .Net? So that the only thing
displaying in the installed directory is the exe file?

Thanks
 
P

Peter Duniho

I have an application written in C# 2003. The installation package for
this
was done through .Net, and when it was installed on the target machine I
see
it placed there not only the exe, but also the .cs and .resx files (from
the
modules and forms used), as well as the .rpt files for the Crystal
Reports
(v10) used by the application. My intention is to have the target
directory
for the application only have the EXE file and run properly. I've seen
remarks about Installshield, when I tried that with a C# .Net install
wizard
it did only install the exe, but erred out due to the missing .rpt
(Crystal)
files. I've also seen something regarding an ILMerge utility, but am
unfamiliar with that.

With VB6 when you did an install, the exe would 'combine' any report
files
into it. Is there any way to do this with .Net? So that the only thing
displaying in the installed directory is the exe file?

A VS Setup project should not be copying source files, like .cs or .resx
files. If you have an installation program that's doing that, it was
configured incorrectly.

As far as including .rpt files as part of the installation, that can be
done as well. Just include the necessary .rpt files from your solution as
a file in one of the destination folders for the Setup project. I don't
recall whether the Setup project wizard offers the opportunity to specify
additional files like that, but if not it should not be hard for you to
find the necessary place in the Setup project to do it manually.

Pete
 
J

Jesse Houwing

* Peter Duniho wrote, On 8-9-2009 20:55:
A VS Setup project should not be copying source files, like .cs or .resx
files. If you have an installation program that's doing that, it was
configured incorrectly.

As far as including .rpt files as part of the installation, that can be
done as well. Just include the necessary .rpt files from your solution
as a file in one of the destination folders for the Setup project. I
don't recall whether the Setup project wizard offers the opportunity to
specify additional files like that, but if not it should not be hard for
you to find the necessary place in the Setup project to do it manually.

Pete

If you specify the type of the file (Compile action in the properties)
as Content, you can select all files of type content in your installer
project and specify where they should be installed (using the default
..NET installer project).

You can also set the type of the report files to Embedded Resource, they
will be included into the executable itself. Though you cannot
instantiate the Reports directly by pointing to their file location (as
they're no longer single files), you can either use a
ManifestResourceStream to read them and write them to a temporary
location, or if the Chrystal Reports supports reading rpt files from a
stream (I don't know this for sure, sorry), pass the
ManifestResourceStream directly.

Information on accessing these internal resources from code can be found
here:
http://support.microsoft.com/kb/319292

and in the MSDN library.
 
M

manas

If you are creating the setup.exe using Setup project in Visual
Studio, in the setup option, select ony Primary Output from selected
projects that needs to be added in the setup.
By this you will not copy source files in the deployed pc.
 
R

Rob

OK then, what are the required files that I must include? I saw that the
Source Files was open in the Setup Propeties (I inherited this app). When I
remove this item, it installs on the target computer fine and the source
files do not show, but I still get an error trying to run a Crystal Report.
On the development machine, under the Application Folder of "File System on
Target Machine" I have:

Debug Symbols from <appplication name> (Active)
Localized resources from <appplication name> (Active)
Primary output from <appplication name> (Active)

Where <application name> is the name of the app.
If I add the Source Files but specify them as Hidden, it does work, but then
there's the question of the user on the target machine being able to go in
and modify the viewing options to see hidden files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top