2

This is the first time I am creating an installation. I need some help on this.

  1. I use the Publish option when creating my setup. When I finish installing, the setup installation path contains all the .cs files as they are visible during development. This allows any person who has VS installed to edit my application.

    As an alternative I tried using Advanced Installer, but the same thing happens there too. I would like to continue using Advanced Installer as I would like to use their themes and Trial and Registration Features.

  2. I am currently using the Trial And Registration feature of Advanced Installer. This feature creates a DLL in the installation directory. How do I use a relative path to link to my DLL?

  Environment.CurrentDirectory = Directory.GetCurrentDirectory();  
  string dllPath = Path.GetFullPath(@"..\..\Trial.dll");

The above code works fine during development. But when I install the EXE, it returns an error. According to me there is an error in the path.

While installing I use this path:

C:\Program Files\ManufacturerName\AppName\

When the installation completes, the folders look like this:

C:\Program Files\ManufacturerName\AppName\<My CS files are here, on a silver platter>
C:\Program Files\ManufacturerName\AppName\bin\release
C:\Program Files\ManufacturerName\AppName\bin\release\<app.exe here>
C:\Program Files\ManufacturerName\AppName\bin\debug
C:\Program Files\ManufacturerName\AppName\obj\x86
C:\Program Files\ManufacturerName\AppName\obj\x86\release
C:\Program Files\ManufacturerName\AppName\obj\x86\debug
C:\Program Files\ManufacturerName\AppName\Properties
C:\Program Files\ManufacturerName\AppName\Service References

There are files present in these folders. It's the same as my project path.

I am also open to using other installers that allow me to have something by which I can have a one time installation.

Community
  • 1
  • 1
Tanmay
  • 341
  • 2
  • 6
  • 22

1 Answers1

2

When i finish installing the setup installation path contains all the cs files as it is visible during development.

This happens because you added your entire output folder in the setup project. You're supposed to add only your application files. If you don't know which are your application files, you need to find out.

As an alternative i tried using Advanced installer but the same thing happens there too.

Did you try the Visual Studio Application project type? It imports only your application files.

How do i use a relative path to link to my dll.

The licensing DLL should be placed next to your application EXE. This way you can access it directly by name without trying to use relative paths.

Please note that in your setup project you can move the files in any folder you want.

Cosmin
  • 21,216
  • 5
  • 45
  • 60
  • There are certain problems that i am facing. Firstly i cannot add a new setup wizard project because i am using the express edition. So i am forced to use an external installer. The external installer outputs the entire project and i have tried to find out why this happens but haven't found an answer as yet. Everything should necessarily be in one folder, which is not the case with Advanced installer. – Tanmay Sep 07 '11 at 04:25
  • Advanced Installer can import your Visual Studio application project. It doesn't need a setup project. – Cosmin Sep 07 '11 at 06:16
  • That is true. I directly add my project directory and build it. But the output still comes the way i said earlier – Tanmay Sep 07 '11 at 06:20
  • I have set my the output type in my project (inside VS) as Windows Application. Do i need to change it to Console App or Class Lib? – Tanmay Sep 07 '11 at 06:25
  • When creating a new project, select "Visual Studio Application" specialized template. You can then select your Visual Studio application project (it has .csproj extension). This way Advanced Installer will import the appropriate files from your application project. – Cosmin Sep 07 '11 at 07:25
  • By the way i found the solution. I was giving advanced installer my entire project path. i just need to give the release path. Also the VS application template fails to load at my place. Some error with VS. Anyway problem solved for now. And as the list continues i now have a new one. "File Access permission not set" i am retrieving an image from MySql and it works fine while development but fails at runtime :( – Tanmay Sep 07 '11 at 16:29