0

I have two VS projects. One is to install something, the other project is an installer, basically a nice neat installer with pictures that calls the first project at the end to run the setup.exe.

Now, I want to publish this so that, someone can, on their computer, not mine, they can open my folder, open the setup file and it'll install fine, without errors like my setup.exe file being on my machine and not theirs.

Is there a way in Visual Studio where I can include that setup.exe file in my resources folder or what?

I was also thinking, when you say publish, there is a server option? I just have no idea how that works. We have a sharepoint website where we keep all our information.

Please and thank you.

Murray Foxcroft
  • 12,785
  • 7
  • 58
  • 86
James Heffer
  • 686
  • 1
  • 6
  • 17

1 Answers1

0

Have you considered bundling your executables (installer and application) in to a ZIP file and having that downloadable? It wont launch automatically but it is a neater and preferred approach (from a security standpoint). If you have a thick client application, have you considered ClickOnce as a better option for deployment?

For neater and more secure options, look at the deploying section in here for best practice.

For your set up, you need two actions:

1) Download the setup file, use WebClient.DownloadFile and store it locally. Alternatively, include it in the project and set the copylocal attribute so that it is part of the deployed binaries. Alternatively, this post tells you how to add it to the resource.

2) Use Process.Start("{Path to your downloaded setup.exe}") to launch the set up from your installer.

Community
  • 1
  • 1
Murray Foxcroft
  • 12,785
  • 7
  • 58
  • 86
  • ClickOnce? Is that the default way in Visual Studio in which you publish a program? I have thought about zipping the folder and all that, but what I want is... Basically I have made an installer, a windows forms where it asks for your name and company, asks for you to accept a EULA, then to enter a serial key, then the last step is the call a setup.exe file, which installs something into excel. – James Heffer May 04 '16 at 06:55
  • Now, I want to have that excel addin installer, which is called as a last step in my installer, I want to have that file/folder brought up, or called, not downloaded and then further you have to open it, and install it yourself. I want my installer to retrieve that file from somewhere remote so that I can install this software on other computers. Hope this makes sense. – James Heffer May 04 '16 at 06:55
  • Also, I was wondering if I can't add that excel add in "setup.exe" file, along with the VSTO file, if I can't add those two files into the resources folder or something and have that resources folder also published when I publish my program? And then somehow tell the 2nd installer (my one) to call a file in the resources folder... I don't know... – James Heffer May 04 '16 at 06:57
  • Added some options for you to consider. – Murray Foxcroft May 04 '16 at 07:34
  • I am using the Process.Start method to start my setup.exe, but that's on my local machine. Is there a way I can include that setup.exe when I publish the program? Also, I just installed an extension that lets me create a Setup Wizard. No idea how to use that though... – James Heffer May 04 '16 at 08:01
  • http://stackoverflow.com/questions/13031778/how-can-i-extract-a-file-from-an-embedded-resource-and-save-it-to-disk will show you how to embed the resource. https://msdn.microsoft.com/en-us/library/cc442767.aspx is an alternative option for deployment - a full example. – Murray Foxcroft May 04 '16 at 08:09