This tutorial came in clutch. Was just about to wrap up a current winform project and was wondering how to make the installer for it. Now I know, thanks Tim.
Mr. Tim Corey, As a learner and beginner as a C# developer, I am in love with you. I learn a lot from your videos and your way of talking and explaining things is very awesome. Thank you so much for your time which you invest in people like me. May GOD bless you Sir :)
Thank you Tim for such a detailed tutorial. I really appreciate the time and effort you put into your videos. It's the small details you explain which matter the most to me, for example when you explained why the @ is used before a path string.
It's nice and uncommon that You take care of the recordings that you posted some time ago. Thank you for the time and energy You put into promoting knowledge.
I have zero experience with ClickOnce MSI or install shield. This is exactly what i have been looking for. A simple explanation of this complicated process in its simplest form. I now have a foundation to move forward and learn other techniques.Thanks!
Are you still going to make the future video showing how to automate this? As well as showing an example of how to do it through a different server, thank you for the amazing content !
Hello Tim again, I just wanted to thank you very much for your videos... I asked you on the video of SQLite demo video about a problem I get in deployment, but now with Squirrel, it is solved... So, Thank YOU A LOOOOOT! GREAT WORK SIR!!!
wow you save me! from clickonce, now I can deploy my apps using sql ccmpact edition and cryptography that click once does not support! Thank you for this amazing material.
This video is...AWESOME!!! The way you explain everything step by step is incredible. I have a lot of question, actually..a lot of requirements but I'm pretty sure I will find answers on your videos!!! Thank you so much!!!
Very nice lecture Tim . Crysp and clear. And i dont know anything about deployment and even Release also in visual studio. I am the basic beginner. And I could understood in clear way. Will be waiting for you next video about Releasing to the GITHUB and autoupdate from GITHUB..
Great tutorial. It would be great if you could show the next level with the automation of all those processes. However it is a good point to start. Thanks.
You have helped me at work, school and even in personal projects. Thanks so much for these excellent videos! I am a much more competent programmer thanks to you :)
Great video. Thanks for the heads up on such an application (Squirrel that is) existing. It appears it will solve the install issue I have for a widely used corporate application.
A part two on the build automation side would be nice also Tim. i.e how to automate the manual steps at the end i.e. moving the folders to the temp folder etc. Do you plan to do a next version?
Amazing video Tim! Thanks for all your useful delivery on this video. Now, the next step would be maybe to give the user the choice to update or not the software version and make an automatic restart if so.
Tim you made my day with this implementation. It is clean and as you mention, predictable and I'd say customizable and most important of all, it can be automated MUCH MUCH easier than a clickonce app. thanks for this great video. BTW. This worked like a charm on a WPF app.
Excellent Tim. It was just what I was looking for. Look forward to see the automated process. Although, as long as it is for a simple and small app I would rather do it manually. Next Time, show us how to place an icon for the app.
Excellent and completely understandable tutorial! I tried it on a sample app and it just works as you described. I’m building an app that needs to be shared and users by a few people in our company. This may be the way as long as people don’t object to the automatic updates. Remains to be seen. The way you drilled down to grab the version number was a feat in database acrobatics and I’m not sure how I would have found it otherwise. Very much interested in a follow up video showing more advanced usage and automation. Thanks again!
0:00 - Intro 1:12 - What we are going to do in this video 3:40 - What is Squirrel 7:02 - Squirrel GitHub page 8:43 - Squirrel NuGet reference 9:30 - Automatic application updates update check 15:55 - Assembly version changes 17:47 - Creating custom NuGet Package 27:04 - Installing the application 29:05 - Running the installed app and fixing bugs 33:49 - Updating the application code 37:06 - Releasing the updates 43:06 - Recap 45:20 - Summary and concluding remarks
Hi. EDIT: Solved: Don't forget to give your Application a Title in the NuGet Explorer. Otherwise it won't show up. lol I have a little Problem: I wrote a little, useless App (400KB) to try this out. Basicly 3 buttons, 1 shows an Info Message Box, 2 opens a URL and 3 closes the Application. I made it as a WPF Solution. I put some Code in the AssemblyInfo (Version) and of course into MainWindow.xaml and MainWindow.xaml.cs. Everything works fine, I was able to put the App onto a Share and the DevTeam could receive it via Setup.exe and the new Version updated automaticly - Good Tutorial, Super easy, Great Job Tim! Now my Problem is that none of us can uninstall the App correctly. We have to delete the folders in order to get rid of the App. I couldn't figure out why that is. Any ideas?
@@IAmTimCorey I forgot to put a Title. It was the reason why it didn't appear in Programs and Features. In Apps and Features I found a nameless program with the same size as the exe. Then I put a Title and was able to uninstall it in programs and features too. Thanks for your reply :)
Good video, thanks. ClickOnce works pretty well in large enterprises where network storage is plentiful and easy to access. Small business clients with less robust infrastructure, however, are not very well-served by ClickOnce. The great thing about Squirrel is it looks like the FileDownloader class accepts a System.Net.WebClient object. This means that you can place the setup files on a password-protected web-facing server, even something simple like Apache. Because you can pass credentials with the WebClient object, Squirrel should have no problems accessing the files despite the password, something that ClickOnce unfortunately could not do. Thanks again for the great video.
I've always just used the installer project in Visual Studio. Despite no longer being one of the default project types, you can still download it as a VS extension from the Visual Studio Marketplace. Squirrel does sound interesting though and I'll definitely check it out.
Yeah, I've struggled with that one over the years. It keeps getting bumped around and it is messy to work with. I almost did a video on it but decided squirrel is a much easier tool to configure and use for updating and it fits most use cases.
Microsoft can be extremely short sighted when it comes to basic common sense things. "Here's a great tool to build software but we're not going to give you any tools to distribute or install it once you've built it."
Yeah, I'm not sure the logic behind not including the installer. I'm guessing it has to do with not being their core focus but even so, they let their partnerships slide. It may be because they want the marketplace to fill this particular spot but it does seem like a rather important part to fill.
ClickOnce is a great tool. This takes things to the next level by being better about errors (ClickOnce does not have a great story around telling the user there has been a problem) and it also fixes some other quirks around ClickOnce. Squirrel also does not need to be used for a .NET application. You could deploy practically anything with Squirrel (Word documents, for example or a Java application).
@@IAmTimCorey : I have a small question- Installer automatically installing application in C:\ Programfile \ . Can we modify setup in a way that it will prompt user to enter Installation location. For example user wants to install in D:\programfile. . Thanks in Advance :)
Nice video Tim and thank you for sharing this valuable information as always. I have a simple question and it is as follows: does it triggers Microsoft Windows Smartscreen if it is shared to other Windows platforms? Thank you in advance!
Sorry Tim I had to take a break due to the upcoming election. Been working my tail off with that plus my full time job been keeping me busy. Will get back to it after November 6
This is exactly the tool that I needed for an application I am developing. Getting my users the new versions of my program can be challenging. The background updating is awesome. I am really looking forward to your future video showing the automatic releasing. I am wondering what happens if the new program files not are all downloaded before the main program is closed? What if the user only has the program open for a few seconds and the network connection is slow? A second question would be what happens if I am over writing the setup files while users program is trying to use them? Will that file be locked out somehow and be unable to be copied over?
Good questions. For the first, if you don't get the entire thing downloaded (unusual since it is a diff, not the full application), it will re-download the file. I'm not sure it will pick up where it left off in the download or not. It might. Either way, it will just work and not cause an issue. The second question was something I should have addressed in the video. There are no problems with locked files because it puts the application in a new folder (using the version number). Then, when you restart the application, it launches the new exe in the new location. It only keeps the previous version of your application so don't worry about hundreds of applications being on disk.
@@IAmTimCorey Thanks for the reply Tim! To clarify my second question: The step after "releasifying" using Squirrel 41:20, you copy the output files from releases and paste them over the "network location files" 42:05. Will this interfere with a user's outdated application which is trying to download the new files (maybe using "Releases" or "Setup.exe" or "Setup.ini") when I paste those files. Additionally, what if some files are copied but others are not when the user's outdated application wants to check for updates (some kind of strange race-like condition)? Could we use the Task object to monitor the result of the update check and be sure that after awaiting the task, Task.Status = TaskStatus.RanToCompletion of something like this?
This looks like more work than InstallShield and I generally prefer to pay for software if I'm going to need to rely on it to produce commercial apps. I want to be able to pay for support and updates and know I'll get both.
Fair enough. I tend to show solutions for free versions of things so as not to limit my audience. I also don't want people to think that the only way they get good products is through paid applications. However, there are a lot of good paid solutions out there. Also, support and updates are definitely important to commercial apps. Good points.
Very nice tutorial! Thanks. I don't know if you already have an update video with app elevation... sign a certificate inside of the Nuget Package Explorer... Multiple executables in lib et45 folder... (a sqirrel-aware app) etc. Normally a app is more complicate... :-)
Squirrel isn't designed for overly complex applications like that. That isn't a typical use case. In that case, you would want a more complicated installer to go with your more complicated setup.
I don't agree with what you said about at the beginning. Squirrel installer is harder to manage in larger enterprise environment. Also remember that the most common best practice for those environments is to disable automatic updates. Still, great tutorial : )
Thank you so much Tim for your many helpful videos. I just learnt about you recently through youtube search and your videos have been incredibly helpful. I am actually new into programming generally and even more so with the c# Lang. Please I want to know if you have a video on winforms software licensing and protection. If not please kindly do a video about that. You can as well point me to any good resources that might be helpful for me to understand and make good choices. I am working on a VSTO Word Add-in, which is how I normally choose to do my learning and I believe the methods of deployment & security applies across all projects that are .Net. Again, thanks.
Check out this video that I made to help folks plan their training. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LUv20QxXjfw.html. Also, you can check out my whole channel and playlists here - ru-vid.com/show-UC-ptWR16ITQyYOglXyQmpzw
Good tutorial! Off topic -> I'd like to know whether Desktop application development is a good Field out there in the industry? Like, will I be able to go for a highly paid salary?
@mike m.: Really? Is there any WYSIWYG app development environment targeting the browser/JavaScript that is as simple and effective as WinForms in Visual Studio? It's a serious question.
I hear this a lot, which is funny because I also rub shoulders with a lot of consultants. For example, at the Microsoft MVP conference this past year, a question was raised about which desktop UI was most prevalent. WinForms won hands down (80%+). When I ask about desktop vs. web, the responses are mixed. A lot of companies have desktop apps and a lot of startups are creating desktop apps. The reason people think desktop is dead is because they forget that there is more out there than just small shops trying to get their product to a large market. Enterprises especially use a LOT of desktop applications. Think of all of the applications on your computer. Most of them are desktop apps (Office, Visual Studio, SSMS, Audacity, Beyond Compare, WebStorm, Notepad++, flux, and more are just a few of the ones I use daily). Web apps are great for distribution but desktop apps still beat them out for power, ease of development, offline capabilities, and more. Here is my advice: learn C# really well (the language, not the user interfaces to it). People often think that C# is a UI. It isn't. The UI uses C#. If you are skilled just in a UI, you will always struggle. If you are skilled in C#, you will do well no matter what UI you end up working with. Most companies don't care as much about your UI of choice as they do your skill level with C#. That is where the real work gets done.
A quick look on Monster.ca proves that isn't true. There are a couple jobs in just the first page of the search that are for C# desktop developers. Web development is a big deal because of the perceived lack of expense for the reach. However, these statements like desktop development being "dead" are just not true. Like I said, learn C#. The UI doesn't really matter. You want to do all of your examples in MVC? Go ahead. It will be a lot more setup work but you can do it. Anyone who throws out a good tool because another is also good is foolish. Take advantage of both tools. Don't just throw out one for the other.
This is awesome, thanks for sharing. This seems like a silly question, but I assume it's best to make 1.0.2 from the 1.0.1 .nupkg file (so the delta only shows the difference between these two), rather than making 1.0.2 from the 1.0.0 file again (which I gather would show all the differences from the very first release). Edit: new problem, noticed that every release I make, even if I made no change to the database file wipes the database on the updated end. Can see this between 42:45 - 42:50. Probably more a conundrum if the database structure itself needs modifying. Guessing fixing this requires accessing the AppData folder to grab any existing user-entered data and re-inserting it after the Squirrel update.
As for the versioning, you don't build from the nupkg file, you build from the source so I'm not tracking how it went from 1.0.0 to 1.0.2. The source changed so we changed the nupkg file. As for the database, yes, this is not an ideal way to deploy a database unless it was used for caching (and an update would wipe your cache). If you wanted to save data between versions, you would need to include update scripts instead of the database.
and you just got data loss.. "Jane Smith" is missing after the silent update. So better don't ship the database with the executable and instead let it be created if nessecary. Btw how can you implement a db update script with squirrel?
Yeah, I forgot to mention that. The bundling should not have included the database or the database should have been set not to overwrite. I'll add update scripts as a suggestion for the next squirrel video.
I know this video is a year old, but I do want to point out, it appears you are using the file version to display and not the assembly version. I know you change both whenever you build, but yeah.
I’m not finding any follow up videos where you go more in depth, such as using a URL for the update location. Did you ever make any update videos? -Thanks.
I tried using URL from IIS Server and failed with 404 error but works perfectly if i try local path. Please if u have any video on URL kindly notify me. Thanks
Thanks for super clear video, in my case it failed and I cannot get the Squirrel -releasify step to work I get many ‘System.Exception: Failed to modify resources’ errors. I think I will go back and see if I can get the ClickOnce to work.
I would check the folder permissions and change to a local folder temporarily to test to see if that fixes the issue. It might be a pathing issue or a permissions issue.
Another great video Tim! Thank You! However, to all your viewers who may consider using Squirrel, IT DOES NOT WORK FOR CONSOLE PROGRAMS. Just hope I can save someone else hours of troubleshooting in case they primarily build console apps.
@@IAmTimCorey My first try was a console app too. I could install it, however it failed to execute all the time. Then I made little useless WPF App wich works, but I can't uninstall it
Great content... I love it. However, I realized that when you make the update, the data of the prior version in the application is lost with the new update. How can one fix this??
Yep, the idea here would be the database is a temp storage that is ok to overwrite. If you don't want to do this, you would need to either not deploy the database with the updates or you would need to have some type of programmatic check on if the database should be upgraded/migrated.
For example me I don't overwrite the database, if I made some changes in the database (new columns, tables, triggers ...) I write a script in the first form to check if this db have those tables or columns, here's an example of me checking if a table exists; string sqlTable1 = "IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='table1') " + " CREATE TABLE table1( " + " rowid int IDENTITY(1, 1) NOT NULL, " + " datec datetime2(0) DEFAULT GETDATE(), " + " dateo datetime2 NULL, " + " ref nvarchar(255) NULL, " + " CONSTRAINT PK_llx_saisie_caisse_rowid PRIMARY KEY(rowid) " + " )"; SqlCommand cmdTable1 = new SqlCommand(sqlTable1 , cnx); cmdTable1.ExecuteNonQuery();
Hey, the video was really helpful. I'd like to make it even better by automating the tasks you mentioned. I looked for the follow-up video but couldn't find it. Are there any updates on this?
it seems, that for an automatic update, you must not change the second number in the version number. For example changing 1.1.1 to 1.1.2 works fine, but 1.1.1 to 1.2.0 does not.
Just wondering how this is better than ClickOnce. I was able to get ClickOnce deployment with self-updating from intranet site working perfectly. The only downsides with ClickOnce are inability to create Test vs Prod versions of the same application and when an update is forced via the minimum required version, it cannot be easily reverted (without publishing another new version and incrementing the minimum required version again). What was it about ClickOnce that made you go down this path?
There are a couple things, including the fact that ClickOnce seems to be touchy. Rollback is easy, no UAC is nice, background updates, easy package creation and hosting, and a lot more. The bottom line is it felt simpler with more power vs. ClickOnce. That isn't a knock on ClickOnce though. If you find it works for you, I don't see any reason to switch.
Sir can you please make a video on best way to give trials of actual software , Serial keys or date based verification can be bypassed anything that can work more better ?
That's a bummer! That was a great project. It will still continue to work with existing projects and should be fine for long-term use but I'll have to work on some alternate options.
Nice video easy to understand, Can we update the database file especially if it's a SQLServer database, and also what if we use the application as a network version where we have the database stored on the server, or is that to much to ask for from this free tool.
You mean keep the same version but have newer code? That isn't something you should do. If you make code changes, you should change the version and make a new deployment. Even for a bug fix.
@@IAmTimCorey By config file I meant the Properties.Settings which my program uses to save and load data, but after every update it resets everything. I just want to exclude saved data from updating.
GitHub isn't really a file hosting location. You might be able to make it work but that isn't what it is designed to do. You really want a web host for that.
I read through the comments to this video but didn't see an answer to my question so I will ask it... How do you go about deploying updates without overwriting the SQLite database? In the video example, you added a person (leaving 2 people in the database), deployed the update, then ran the program again reverting back to a single person in the list. Obviously, we want the users to not have to start over from scratch when deploying an update such as adding the version number to the title. Thanks!
Good question and it is something I wish I had remembered to cover in the video. I'll be covering it in another video. You have to make some tweaks to the installer.
If only that person other day new who Tim Corey was he wouldnt question your programming skills nice tutorial needing this myself for a dekstop app that goes out to 8 clients how does one use this for updates as well is their a way to tell it not to overwrite the users app.config
The easiest thing to do is store the changeable settings in something other than app.config. I believe by default it overwrites the app.config each time but I'm not certain. The other option would be to do some scripting to handle avoiding the overwrite.
Hi Tim, this is a great video. It answer all my question about creating installer and version updated. I have one problem here. I simply put my application setting into files. And this squirrel update process will created new version folder, which make me lost my setting files in old version folder. Do you have any idea to solve my problem? I have in mind to put my setting file in different directory, but i don't know where to put it. thanks for sharing
You would probably need to write some code to move your files into a different location and then only create them if they don't exist. As for where, that would be up to you.
I was able to fix my struggle with hosting deployment on IIS server after 12hrs of troubleshooting. Everytime i query the URL path from the server, i get an error message (Status Code 404 not found). Long story short. It has to do with the MIME. The RELEASE File couldn't be read because its not supported in the MIME collection. To fix, kindly add the following to the web.config extension. I hope this help someone
Great video, as always... You have used SQLite DB for database storage which makes it easy to update the database structure... Is there a way to update the sql server database for any changes that have been made in the SQL Database Project.... e.g. If I have added a new table and some stored procedures to the SQL Project, is there a way to check whether the database structure has been changed and make the necessary changes to the deployed database...
I have this working from an S3 Bucket - How can I test for a new release being available on the server - then notify the app that a restart is required, with a checkbox or similar?
Hey Corey, great video, works like a charm. I'm wondering, when you have the spare time if you could do a video with a HTTP Server. That way, the binaries would be put on that HTTP Server and the application should check that URI. Thank you, and I will subscribe on Patreon soon !.