1

I want to create a Setup Project that loads a file from a specific path (the same place of the setup.exe file folder).

I know how to create a setup project and how to load a file from a static folder (like Debug folder).

How can I change it to a dynamic folder / path?

I hope I am explaining well enough?

This is example of what I want to get at the end: enter image description here For now, I only get the .msi and the .exe files, I want to add the .HEX file so when I click on the setup.exe, it finds the file from the same folder.

Thanks for help!

Hexie
  • 3,955
  • 6
  • 32
  • 55
user2235615
  • 1,513
  • 3
  • 17
  • 37

3 Answers3

0

I did a little research for you. This SO answer will show you an excellent way to get the application's base directory. From there you can just append the final folders and plug in the file name.

EDIT: from your comment, I believe that you are looking for this:

string path = @"C:\C# Projects\SQA-V Flash...";

From there you can just append the rest of the info. Oh, I put ... in there because your snapshot doesn't include the entire folder name.

Community
  • 1
  • 1
bubbinator
  • 487
  • 2
  • 7
  • Thanks, But I don't want to get the application base directory, I want to get the setup.exe folder(for example setup.exe is located in "C:\New Folder" and the application base folder is "C:\Program Files (x86)\My Project folder") And how can I append it to the Setup Project? – user2235615 Apr 07 '14 at 05:05
  • My typical method for that is to use a string literal that holds the folder you want. I'll edit my answer with a simple one using the path you put in your question. – bubbinator Apr 07 '14 at 12:04
0

If your app is installed and running and you now want to know where it was installed from, your setup can create (in the registry view of the setup project) a registry item somewhere and set its value to [SourceDir] and it will resolve to the actual installation source. Your app can read that item to get the location.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

Ok, the Answer is this:

In the Application Folder I added the desired file. and than in the properties of the file there is a parameter - PackageAs" this parameter by default is "vsdpaDefault", change it to "vsdpaLoose" and that's it! It is that easy, but it takes me 1 day to find it :)

Thanks for trying to help!

user2235615
  • 1,513
  • 3
  • 17
  • 37