0

Hi i would like to know if i can write code into a File.Create(Directory.GetCurrentDirectory() + "/Name.exe") that is in c#.

My purpose for this is I need 2 applications, one is a launcher and one is a updater, i originaly had a File.Exist looking for the updater so no errors occured, but i would like it so you only need the launcher at first then it adds the other folders and files when you first open it.

  • Hello and welcome to Stack Overflow.Please take time out for a tour(http://stackoverflow.com/tour) and visit the help center(http://stackoverflow.com/help). You might also want to read How to Ask(http://stackoverflow.com/questions/how-to-ask). – Rohan Khude Aug 11 '16 at 05:08
  • Just add all the other files you need as embedded rescources – whymatter Aug 11 '16 at 05:10

1 Answers1

0

Instead of reinventing the wheel try using ClickOnce

If you're going to need a certificate if your app is to be signed and publicly distributed. You can work with a test certificate for development

Build your app, right-click on the main project and pick Publish (also on the Build menu), follow the wizard

The target location you pick will end up having an app.application file and some folders, one for each version you publish. You can put these files on a file server somewhere and share the link to the .application file with your users. Every time you publish their app will get updated the next time they use it.


If reinventing the wheel is your thing you can build your app, make another project checks a link for a file that contains a version, compares with the local version and downloads if newer, then launches the downloaded exe.... just like clickonce

Sten Petrov
  • 10,943
  • 1
  • 41
  • 61