-5

So i Have this c# application that contains a button allowing a file copy from a network share folder.i use a vbscript to copy the file, this script takes the source and destination path.now i want to create a setup to install my application on any PC connected to the LAN. the thing is the path will eventually change so i'm not sure if it will work.

I never made a setup before and i'm wondering if there is a way to customise the setup to allow the installer to make the changes.otherwise any solution will be very helpfull. thank you

Aymane
  • 1

1 Answers1

-1

I don't normally like giving answers that are mostly links, but it is too much to post here. Here is a quick summary:

There are quite a few things that can do what you are asking. The one I like is called Squirrel. I recently had to learn how to use it while deploying an application for my company.

The steps in a nutshell(see what I did there? :)

  1. Build your application (optionally add the update checker code first - see links for details)
  2. Package your application into a .nuget file using Nuget Package Explorer(details in links below)
  3. Run the squirrel --releasify on your nuget
  4. It will output the setup files that you are looking for in the Releases directory.

More information (that you will likely need):

Github - Squirrel.Windows

Youtube - Video tutorial that I found helpful

Github - Squirrel Getting started guide

As for your vbscript, I would do the file copy inside C#. You are very likely to run into permissions issues when using vbs. In any case, why add the complexity of 2 different languages when C# can do a file copy easily.

Something like this during your application's startup.

if (File.Exists(localFileName) == false)         // check to see if the file is needed
{
    File.Copy(sourceFileOnLan, destinationFile); // get the file
}

If you are really set on using a vbs file, you can launch it using Process.Start() and let Windows execute it.

Also, you can store the paths in your app.config file, and update them if/when they change.

Thoryn Hawley
  • 335
  • 1
  • 7
  • If it's to much to post here, chances are that the question is too broad and shouldn't be asked (or answered) here in the first place. – Ansgar Wiechers May 29 '19 at 11:07
  • So it is a better practice to downvote the new user's question without any direction or comment at all? you can sum my answer up to "here are tools to do your own research" rather than the dead air that everyone else was providing. – Thoryn Hawley May 29 '19 at 21:10
  • Thanks Thoryn for your answer! I made a setup using ClickOnce, but i still can't see how to use an app.config file to configurate my setup installation – Aymane May 29 '19 at 21:36