MSIX Installer for Desktop Applications - Packaging WPF, WinForms, and UWP Applications

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
creating an installer for a c-sharp desktop application you used to involve a third-party solution link install shield to create MSI or setup files with the addition of UDP or Universal windows projects Microsoft created the MSI X installer option however until recently it only worked for you to UPA now we can use the MSI X installer to install wind forms and DPF desktop applications you don't even have to go through the Microsoft Store if we don't want to in this video we're gonna look at how to create those MSI X setup packages how to include our project in the package and how to install and update our application on the client machine now if you've never watched a vo of money for my name is Tim quarry and it's my goal to make learning c-sharp easier one of the ways I do that is by teaching context you'll find lots of toriel's out there they'll teach you what to do I go a few steps beyond that to show you when to do it why you should or should not do it what pitfalls to avoid and what the best practices are basically I get you ready for the real world if that's the type of training you're interested in subscribe to my channel and hit the little bell icon to notify my leads new videos finally in the description there are links to get the source code for this video - Sai from a mailing list to join patreon and you get access to all my courses as well as links any links I mentioned in today's video if you're looking to make a career out of sharp or way better in your seat up career my content can launch you forward faster check out all I have to offer I am Tim Cory comm or SAP my mailing list to hear from me directly ok let's go to visual studio now we're going to do is I'm gonna create a brand new project or creates a WPF application it's a dotnet cor WPF application and I call this my WPF demo app and this is going to be my installer demo project or install demo let's call it that it's not a project it's solution this is my installer demo solution and inside there I'll have a WPF demo application now this is not a WPF demonstration it's not about making a DPF app I've got a whole playlist under APF if you want to start using it but we're going to do is we're going to just create something that is obvious what's going on so let's just I'm gonna put on here a label or a text block so text block and we're gonna say that this is gonna say I don't know this is our first version alright notice the upper left-hand corner there's our first version and we're gonna make this bigger so font size is much bigger let's go with oh I know let's go with 38 like so and then let's get some padding with some margin margin we'll give it margin of 20 like so there's our application really not about the application okay this is a somewhat horrible looking application but it gives us something to work with okay so if we were to run this right now it's just gonna have just this that's all its gonna be but I will demonstrate how it looks so you can see this is our first version it says main window up here the little icon kind of ugly but again it works alright so now we're going to create an installer for this really amazing application right click on my solution say add new project and what I'm looking for is let's look for the Windows application packaging product project so Windows application packaging project and there we go there's our Windows application packaging product project if you don't have that in this list first of all make sure that you clear out all these filters and then try again but maybe you're filtering out a different language or on a different platform for example WPF this would not show up because it says only you do you P and windows doesn't say WPF you know it can do WPF alright so make sure you clear your filters out and try again if you still don't find it then you probably don't have the you do PE options installed in Visual Studio so you have tools me up here and the very first option is get options and features I believe it's called click that and it's going to create a an installer page gonna pop up since hit a little bit it'll probably give you a prompt saying hey do you want to allow this elevator permission thing and you say yes and then it's going to give you the the setup page for configuring Visual Studio just make sure you have the you WP or the universal Windows platform project options selected and then that should install this MSI X installer for you okay that's this template so now I have as template Windows application packaging project I hit next I need to give a name so that's going to be our this is our our packaging project let's call it demo installer it creates and the first things going to ask you about is the version of Windows to install on now if you watch my video on you to you P then you'll be familiar this dialog it's very similar we have any dou P and it what does it ask two different versions first ask what's your target version what's the version that you you're hoping will be on every machine at least and that you're gonna make sure that all your applications point to as far as being able to this is the maximum they can do is a target the minimum version is you don't allow it to be installed on anything before this minimum version now it does your platform but it does allow you to have more features for example if I chose the minimum version here of the anniversary update one of the things that would not be available to me is the ability to update my application so there's newer things in here that allow for updates even with side load applications so we'll see that I'm gonna choose to leave it just like it is with 1903 being the target and 1809 being the minimum version that's pretty restrictive but for my audience is fine for your audience may be different remember just because Microsoft doesn't support something doesn't mean it's not out there so the support for Windows 7 is gone and even some of the older versions of Windows 10 or no longer support it that doesn't mean they're not being used alright so just know that you have to know your audience hit OK and this will create the project for us so opens up a nice little page with some helpful links but let's close that out we don't need those it's kind of constructions right you don't read them so let's look at what the demo installer has so it has a manifest file we'll open that in just a minute it has an images folder with some images in there let's just open one up this is the store logo it's kind of their default just a green field with a white X on it so we're gonna replace that a little bit and they have as applications here this is where you say what application are we deploying so I'm gonna right click on here and say add reference just say what if I was referencing a dll file only instead of reference a dll file or a class library instead I'm referencing my user interface project so if your user interface projects here this is ours right here if that had a reference to a class library project you don't have to select both you just select a user interface project because when that gets built it will bring you in the class library dll's if needs them so make sure it's the class or the user interface hey okay and so now if expense now you can see that WPF demo app has been included in our demo installer the next step is actually before we start modifying this package dot app X manifest I want to build an icon so I've got the sync fusion Metro Studio 5 open here this is free from sync fusion you get just by giving them your email address and they'll send you it an email and register you to have this for free and it's an icon studio we're create just a dummy icon something to just have okay so let's let's choose something in the let's go people category and I kind of like this this running athlete here so let's hit the edit button here and let's make the background transparent alright and we need a different color than this let's make it about that or do you want it something like this let's go to blue I like blue alright so use the eyedropper and just actually put it over in my visual studio and found a color like you can also go with green if you minds up here or you can give it an actual color but I think blue is it's good so with that what I'm going to do is I'm going to make sure my my fonts but you know if it's 512 by 512 let's make it even bigger so let's go with 2048 by 2048 and the padding here I don't like much padding at all in fact I'm gonna go with a pretty small pad of only 30 pixels or so 32 is fine alright so there's my my icons it's really big now but they scale nicely may hit export and let's go to my installer demo and hero athlete PNG is fun so with that I've now exported my icon I have that in a a file I'll copy the the paths that make a package dot app X manifest double-click it and we use that icon just a minute but first let's give us a display name so this is the the information that will be displayed for application this is our tIMCO demo app as a display name and this is a a simple timko wreath actually timko application demonstration huh demonstration application about that all right something like that now some of this stuff is going to be mostly for youdo you P so for example the the supported orientations we don't have to worry about that all right you can leave it alone now if you really want you could say certain ones are not supported this is more for a full screen application though like a you do you P application that's only I do this main page though visual assets is the next tab over the next section over and this is where I'm gonna create all of my icons in fact nois small tile medium tile wide tile large tile app icons splash screen badge logo and package logo if you scroll down there's multiple different sizes for all of these and that can get overwhelming there's just so many have to create and if you're gonna create an application and you really want to do it right then you probably have to create that whole set of icons now typically what I do because I'm not a designer is I will outsource that I will go to a logo creation site or two maybe even fiverr.com then I'll say hey I need you know this type of icon here's I'm thinking and then here's all the different resolutions I need and then based upon that I could put then all these different spots notice to a four by 284 142 by 142 71 my 71 and so on all the way down lists now wide tiles they're a little different so it can't be just a copy and paste now there is this really nice shortcut for starting your application out so if you're just starting out or it's a demo application or really is just a small application it's not that big a deal what you can do is know a source here if I click the what should be an ellipsis but only has two dots right now for some reason ellipsis has three so I'm going to paste in that path and there's my my ping file my PNG and notice it has this is 1024 by 1024 if you like didn't go any larger than that that's okay so now I can say the destination is the images folder notice that images folder right there the assets here's our one I create I could do everything for some reason they don't check the badge logo I'm gonna check it so we're gonna do everything scales every scale and how are you gonna scale this do you want sharper edges or smoother edges it's up to you alright apply I recommend padding cool and apply color conversion for windows light theme sure alright with all that being done I hit generate an essay the following files we've overwritten that can't be undone that's okay because those files are those temporary placeholder files okay nstead create a whole bunch of files frame there you go notice all the files now that I have there's all different sets we scroll down here notice you can see it's a little hard to see sometimes because that that black there gray and white checkered background which means transparent but there's my little running person in all these different resolutions all right and it didn't stretch it weird for these these longer ones alright so here's me a it's small it but it's still visible it's not stretched out weird you can still see what it is alright so that I've now created all my different icon sizes natively and now that it will work properly those different resolutions for display name I want to call this we call it in the application side we call it Tim code demo app a lock screen notification we want badge and title text sorry so it did yell me about that which is cool so Tim code demo app for display name so visual assets short name Tim code demo app is still short enough it's fine I do want to show the name on a medium tile the wide tile in the large tile these are for when you take your tile your icon and you put it into a Start menu so you have that different tile sizes you can do well with that do you want to show the display name on the short or the medium tile the wide tile a large hell yes yes and yes you don't have to do all right I'm gonna leave everything else the same capabilities I'm not going to touch this is more for UDP UDP lives in that sandbox where you only have access to what you asked for so you don't check the Bluetooth then you don't get access to Bluetooth with WinForms and APF it's a little different they operate with basically full access to the computer and so because of that we're gonna see in the installer it's gonna say hey they have full access but we don't have to specifically check these boxes in order to get that full access declarations same thing we will have to clear anything here so I'll leave that alone content URI this is for notifications again we're not gonna do anything there so now we're at packaging so packaging we have add a package name which the name is gonna be a gooood that's good we want to be unique the package display name let's give that a different name okay what the tin code demo app as a package display name and we have the version information major minor and build that's cool and we really need a certificate so when you install an application using MSI X you have to have a code signing certificate used to sign that code and what this does is it says I created this code so if you trust me then you can trust this code and the reason for that is let's say that someone else created the tim code demo app but they're trying to pretend they were me well they can't sign it using my certificate because my certificate is locked down just to me so only I have access to that certificate to sign my packages so someone else couldn't sign it as me therefore would say hey I don't trust that package because it's not from a trusted source you have to trust the certificate source in order to trust the data coming from it or the application coming from it this is similar to the concept of SSL on the web where we have you have to have an SSL certificate on your web server in order to use SSL and you have to have from a trusted certificate authority who verifies who you are and so I can't say I'm Microsoft because I'm not and so I can't get a certificate that says Microsoft because I'm not Microsoft I'm Tim Corey so therefore I can get a certificate that says I am Tim Corey and that's fine and then you can know okay this comes from I am Tim Corey and I trust I am Tim Corey therefore I trust that the content has not been modified but if my certificate is used as a I am Tim Corey but I'm saying I am from Microsoft you would know that's not right okay it's a similar concept we have here where we're saying I trust that when it says when the package comes from Tim Corey I trust that package alright that's we're kind of doing here so we got create a certificate which certificates aren't free you can make free certificates but they won't be trusted and so we're gonna see how to use a developer certificate and trust it which you can do it's a manual process but you can do it which is good for internal work where it's it's just you know inside your company that's fine or where it's you know small installations but you're talking about selling out product that you don't want to use a code signing certificate from a reputable company like say Komodo where you have to pay a certain amount a year and it will probably be around a hundred dollars plus per year that you'll pay for a code signing certificate now if that frightens you away here's the thing if you're going to sell you an application there are some upfront fees to be thinking about you're gonna have to do that now if you're going to give an application away or again you're doing internally to your company where you can control which certificates you trust then a developer certificate like this is just fine because the only downside of creating your own certificate and in this developer mode here is the fact that it's not trusted anywhere and so in order for someone else to trust this certificate they have to physically say you get the certificate and say I trust that this certificate is valid I trust the sender of a certificate so that's the big downside of these dev certificates so publisher display name Tim quarry choose a certificate well I don't have one so I create one now I could select in the store so you're going to the Microsoft Store they can generate one for you from a store and then they'll they'll trust it you can do it a death certificate when you're in dev and then the store certificate when you're actually deploying to the store but we're not deploying to a store in this video that's a whole other topic alright there's some Oh hoops to go through there and clean safe your store account and I'll point a little bit to that and give you a link in the description for getting that store account but this is just about cream ice ax installers for desktop applications not even you do you pee the process is the same for UDP but I'm not going to demo it all right so let's create a dev certificate so create and the publishers common name I'm gonna use Tim quarry it's fine and then a password now this password is really important first of all do not lose it because you can't create new certificates if you don't have as password so as pfx file it's going to be your private key this is something you do not give to anybody because if they have as pfx that making create certificates and impersonate me so i don't give this to anybody this is something i secure very well so i create a super secret password [Music] like so and if you're wondering yes this is my standard super secret password for all demos alright so if you want to guess it go ahead that's fine but it's PWD capital P and then 1 2 3 4 5 and dot at the end so if you want to mess around that certificate you can go for it ok because again you have to trust this certificate so I'm going to now can view certificate so there's a certificate notice it says it may be hard to see but says that this certificate is not trusted we're going to trust it into submit but we're creating it first so as expires on February 15th of 2021 alright we're ahead ok now we have a certificate for this application and if we minimize this we also see here we had that pfx file that's now part of our package and that's all we have to do to configure our app X manifest file so it's a it's a pretty step-by-step process which I really like I really appreciate that now if you were to try to create your executed Lord for your MSX file right now it won't work let's do a build first make sure we restore all our files and it rebuilds successfully so you think okay great we're good to go and so you right click on your project the demo installer and you say publish and you have three options here create app packages is one of them or associate app with the store that's if you're gonna associate one time you're gonna associate your project your installer with the store you could do that but in our case we're just gonna create an app package which will be a standalone installer that has no connection to the store it's just for us to install manually or give to people to install we don't have to be insolent through the store but I can't really have a problem here I might show you just a minute I do want to demonstrate this problem because you guys see it probably so let's walk through this this menu I'll walk through the actual app act actual settings so that you can see what this process is even though I know it's gonna fail alright so first of all how you gonna distribute your application to the Microsoft Store or side loading side loading is when you install your application without using a store this is what we're going to do that way I can give you a file and you can install it without having to go through the store and making sure that my applications on the store this is very convenient for internal applications for testing applications for small little application using in a few different places it's not as convenient for selling applications or things like that you really want to use a store for that in most cases so you use side loading which is on by default starting I believe in November of 2019 version of Windows 10 and then you have to if you want you can check us box enable automatic updates yes I want automatic updates that's just awesome it's simple to use and it's great sorry use that I hit next do you want to use a certificate why yes we do if you don't use a certificate you will have to sign the app package before you use it and it would be externally so that's an additional headache you don't want to do therefore going to sign this as part of this process I've already created a certificate therefore we don't need to do anything else here now the time stamp server URL here what this would be for we're not going to demonstrate us here but if you had time stamp server URL they could point to then what would happen is it would trust your installer even if the certificate was expired so the certificate was valid when this install was created then it would trust a installer if you don't have a time stamp server URL then even though nothing has changed except you've passed the expiration date your installer will no longer work once you hit that that expiration date just no that's the difference there you can change the algorithm it uses for encryption so you can go up to shot 512-byte if all is sha-256 I think it's fine for your application let's hit next now this is where we have the the output location that's five I'll leave it alone that's is basically it's inside of our our folder where our project is our version number we have our major or minor and then automatically increment our build version generate app bundle what this does is it makes sure that it creates a bundle that you can get the right value for you in one in one file so if you're installing on a 32-bit machine then we get either it would give you the 32-bit installed if you're installing a 64-bit machine it would give you a 64-bit installer and knows which one to give you so that is a yes to always create an app bundle instead of creating separate files now down here which packages do you want to create and this is where you're going to get into the first problem is which architectures do you want to support neutral is on by default where I see how that's going to cause a problem and then include public symbols file which is a PDB file for crash analysis of the app those symbol files are very helpful for debugging your application so unless you really don't want them to go out and get into the public symbol files I would say include them all right if you're really really concerned about not giving people any information possible you can uncheck that box but just know that you're making your life a lot harder and you're really not protecting your state secrets okay so we're gonna leave us this box right here alone for right now we're gonna say neutral allowed to be default and hit next and then the install location I'm going to finish I'll have my clipboard nope I don't I'll copy and paste it again my URL to where I have my my PNG file and that's where what the Installer will be okay so this is this could be a web application where could point in the web or it can be a desktop location like a URL I'm sorry a file path or it could be a UNC path where it's a network location it's up to you how you want to do this but just note that if you have multiple people installing from different locations you want this to be a centrally located folder or place so that everything can point back to that because this is where applications will figure out if they need to be updated and if they do pull that update down now when do you want to check for updates every time the application runs or every X number of days hours or weeks so in theory you could check every hour that feels like overkill it's up to you but I would just say every time the application runs so it starts up its going to check to see if there's a new update what that means is that it's not going to check until the application starts so the application starts and then new version comes out the person won't get that new version yet when they close the application and start a backup then the application will still be in the old version but it'll figure out okay the next time I start I need that update and so it will wait and then the next time you start it you'll get that update now if you don't want that if you'd say you know what I'd rather have it check every hour in the background and then even if I am working on an older version and new version comes out within an hour if I still am working on an application my application will figure out Oh next time I start I'll get a new version I can save you one iteration in certain circumstances I'm gonna leave it at every time the application runs this down here could become some network bandwidth that might be difficult for you if let's say you have 10,000 applications all checking every hour that might be significant versus just when they start the application up so just know that it all depends on your scenario I'm going to check the the first one though okay now again it's gonna fail I'll show you why we hit create so it's gonna start building our package notice and down here is a little icon that's building and giving us error message and the error message is one that I didn't find a whole lot of good answers online for so I want to show it to you and it says there's a mismatch between the processor architecture the product being built ms IL and the processor architecture the reference which is x86 this mismatch may cause runtime failures may cause and yet some error so what do you have to do well the issue here is our our built it's saying any cpu and that's not ideal so instead we're going to do you go to a build menu and go to configuration manager this is we configure how things are built so I'm going to release I'm going to say for release I'm going to choose the x64 platform and notice down here we have the demo installer it's a little small see if we can zoom in it can't resume in there sorry it says demo installer here and says the platform is x64 that's our installer but the DPF demo app says any cpu if we do a drop down here x64 is not an option so I hit new instead I can choose x64 and copy the settings from any CPU that's fine just don't check this box it says create new solution platforms hit OK and now I've matched up and said whatever you the active solution is 64-bit make sure that both the installer and add a PF app are using the 64-bit platform alright and that's in release mode now I'm going to choose the x86 solution platform notice again we have x86 for our demo installer and any CPU for our WPF application let's create a new x86 do not check the box make sure we copy from any CPU hit ok and now if you got the matching versions here I hit close now I go back to my packet my installer I say publish create app packages and the sayings are still here so I hit next I hit next and then down here I'm not gonna say neutral I'm gonna say x86 and x64 these are two platforms that I will support and with that support I choose release for x86 and release for x64 so now I know that everything matches up so if we're building a 32-bit which 86 is 32-bit if we're building a 32-bit installer it's gonna use a 32 bits MSX file and a 32 bits WPF application and if you're using the 64-bit that's gonna create 64-bit installer that installed a 64-bit do UPF application basically has matching those together it's all it's really doing now I hit next notice the verb afore I do notice the version 1.0 these are the ones that I change major and minor versions but the build number I don't have to change it changes automatically now it says 1.0 point 1 even though 1.0 0.0 failed that build changed so I hit next and I hit create and it's gonna start creating for me my package now this might take a little bit this this packaging process is not always that quick and if you don't have Visual Studio selected what's gonna happen is it's gonna actually not pull up a dialog it's gonna flash at you and when you click back and Visual Studio then it will bring a dialog box up but you need to see so just note that if you click off a do something else while you're waiting click back every once a while and just make sure that box doesn't pop up ok so again this takes a little bit it's already done step one which is the build and now it is publishing everything notice the lower left-hand corner I can feel like nothing's happening but lower left-hand corner and then lower right-hand side there's indicator saying hey I'm still working all right when it's done you get this box right here where it's popped up and says ok we finished creating the package and it gives you an overview what happened first of all here is the location where that package currently is here's the installer location that's what's going to the versions 1.0 point 1.0 the required operating system there is that version architecture is in a 32-bit or 64-bit it is bundled and is polished by Tim quarry now it says to copy the created package from the output location that's this long path right here to the install location that's this path we've selected select copy and close this is a shortcut so notice over here there's that that install location that Dee demos installer demo nothing here except for the ping file but if I say copy and close I go back over here now I have a few things I have a index.html file which is interesting then I have my app installer extension and then I have this folder called demo installer with tests at the end and there is my certificate and my MSX bundle all right so there are my files that I need let's first look at this index.html file isn't this page cool so this is on my local system so Dee demos installer demo dot index or slash index dot HTML it's got my logo here that's kind of cool timco demo app the version number the description of it this looks like a an installer page it looks like a Windows Store page so Microsoft Store page so I can kick get the app and it says hey do you want to open the app installer sure let's open the app installer when you do this is what pops up all right now I'm gonna show you let's close this out from it and close this out if I were to double click on this demo installer dot app installer it has a exact same thing if I go to the index.html page and say install so just know that's what it's doing now this is the generic installer that's going to install the latest version that you have currently only have one version that's gonna install the latest version now note here that does say untrusted app and that's not good so it's not a verified publisher so I'm gonna say you know what I don't care I know that that I trust him I'm don't worry about it let's go ahead install this thing anyways I keep reading it says uses all system resources as an access to your internet connection as well that's basically saying this is an app that has full access to everything and that's me that's a WPF application not a UDP application we can dial in those permissions all right so I install you agree to this this app will automatically check for for and install updates ok cool and launch when ready excellent install this thing and it says no either you need a new certificate installed for this package or you need a new app packaged with trusted certificates all right so a certificate chain processed but terminated in a root certificate which was not trusted all right so there's the error message for us you can't install an untrusted application so how do I trust this thing well if we look inside this folder you'll see there's two things here one an MSI X bundle so this bundle has our MSA X files in it one for x86 one for X 54 but it's also a certificate file this is what's called the public certificate is safe to give out unlike the PF X file over here in our project which is not safety about that's the private certificate the public certificate just says here is what the it will look like to see this certificate if I double click here and open it up it's gonna say issued to tim Corey issued by Tim Corey it's valid from today through next year here's a details about it including the serial number the signature and all the rest all right and there's the path so this is my certificate that I created locally it's a demo certificate that isn't trusted by anyone because no one trusts where they gave it to me I cannot be considered trustworthy of myself all right now I can trust myself and we'll do that just a minute but this is where normally it would come from Komodo or somewhere similar where they have provided for you the the authentication of who you are so I've given them information to verify I am Tim Corrie and they said okay now here's a certificate you can use to sign things so you can say I am Tim Cory we verified who you are and most computers trust certificates from certain authorities including Komodo so therefore that already be a trust relationship so in our case we don't have that trust relationship so we need to install one so this certificate file which again is public it's allowed to go with your installer you would give this to someone they would right click and say install certificates they get this dialog box welcome to the installation wizard let's some even zoom in a little bit there that is better so welcome to the certificate import wizard and gonna ask you where do you want the certificate to go current user or local machine here's the difference the current user will only be for you if someone else logs on your machine it will not be trusted the local machine does take administrative rights to install - but now anybody uses this machine will trust this certificate so choose local machine and notice the little shield icon come up here and that's gonna be what's called a UAC prompt which means the screen will go gray it'll ask you yes or no do you want allow this so I hit next but great it's a minute and I say yes I want to allow that and now from here what you have it's gonna ask you where do you want to install the certificate do you want auto matically select the certificate store based on pilots type of certificate the answer is No it'd be so nice if that was yes but in this case we want it to be a root certificate so place all certificates in a following store hit browse and we have a longer list of certificate places we could install them in this case we want the trusted root certification authorities what this says is these are the authorities that I trust to give out certificates in this case I want to trust myself I want to say that I trust me to give out good certificates now no one else but a fault will trust me until they also do this but in for a demo purpose this is just fine so I'm gonna hit okay I hit next and that's it hit finish and so now we get this dialog box the import we're successful and if I go back to my installer I double click on it now it says trusted app and the reason why is because my certificate is now a root certificate as trusted by this computer only this computer but by this computer so if you were to give give out this installer to somebody you'd also have to give in that certificate file and walk them through the steps while instilling that as a trusted root certificate authority that seems complicated and yeah it kind of is this is why by default we use real certificate authorities ones are already trusted but if you're in a corporate environment you can trust your own certificates you can put that right in a policy and pass it down to every machine in the company that says trust this certificate any fine or if you're doing for a small-scale installation it's no big deal for a couple people to do this or for you know your beta testers or something like that they can walk through this process fairly easily so now that it's installed the certificate that is let's install the application download and install the application and now it's gonna launch the application there you go this is our first version cool so we have the application installed in fact it will be in my Start menu now I can't show you my Start menu it's off my screen but it is there but let's make a change let's go back over here I'm gonna change the the background to be let's go with green and let's change the this is our second version and let's change the for foreground to be white so we have white lettering alright that's our second version of our application major changes major improvements so now what do you do to create a new version well all you do is right click publish create an app package and since he's already done once you can just hit next next notice the new version is too and it's already checked everything's checked it's are good to go hit next hit next and this will publish our new version so we're gonna watch closely on this folder once we gotta wait it won't pop up if I had that folder I highlight it but once this is done it's gonna pop out that same dialog box and say hey do you want to copy us over to that location where I say yes it's not gonna overwrite anything it will still you'll say ok you already have the index.html file you already have your app installer therefore we just need to put that new folder there and it will point to those new locations so it will no it may tweak the index in the app install I'm not positive I'll look at that in just a minute and see the the file changes but it's really you can use those same things and it's gonna point those new locations and it will just install the new version all right so I hit copy and close and with that now we have it did change these two files so it does point to the new location but modify the file but but now we have the version 1.0 0.2 but let's run an open start menu up and run my demo application this is our first version well that's not great right because we want the second version well don't forget it checks for a new version when we start the application it found there's a new version if I hit close and I open it again it takes a little bit longer to open the next time and now the next time you have an updated application very cool now we have an update err that will update our applications as we use them we can close that out and now I'm gonna do I'm going to right click and uninstall that that install application so I've installed my application which by the way the installers for ms ax they try and keep everything together so that when you install everything gets uninstalled everything that means that it's a clean uninstall you're not leaving junk behind like MSF files sometimes did exe files did a little more for sexy and we just got used this idea of my computer continually has junk from when I installed not so much with MSX files I won't say never leave things behind but it takes some work to leave stuff behind alright so I've installed it now I'm going to run this installer again notice it says version 1.0 point - I will install it and this one I just want to demonstrate to you that yes when you install it you get the latest version so even though is an older version here you get the latest version not the older version I'm going to install that version again just to be sure that it's off my computer and now what if you're done working on this application you say ok but I installed it I still have that that dev certificate that isn't really trustworthy but Akaya is trustworthy what do I do with that well if you are on Windows 10 and you should be to have this installer running so I'm going to assume you are hit the Windows key if you hit the Windows key it brings up a Start menu but also allows you to start typing to search for something and search for a certificate and one of the options is manage computer certificates it's gonna be a UAC prompt gonna make a screen go dark and then you get this right here this is your certificate authority list so this is almost if Achatz on your computer that you trust though there's a whole bunch of different folders for the most part don't mess around in here these certificates are ones that you should trust usually but we added a new one in the trusted root certification Authority so I'll open up that certificate list there's a whole list in here but if you sort by let's say issued by or nolan's expiration date so issued by if you scroll down here Tim quarry so Tim quarry is to issue a certificate to Tim Court therefore I can select that and I now know it's the correct one also know the expiration date matches what I expect it to be therefore I know that this is the one that I create don't delete ones that you didn't create now this is a code signing certificate so I can right click on this and I can say delete all right and if I do this it goes away and there's no restoration of this okay so I hit yes and now if I come back with my installer and I try to install this thing it says untrusted app so I've removed that certificate from my computer so that's how you'd remove it when you're done with your development process you don't have to but it really is a good practice to clean your certificates up of the ones you really aren't using so that's how I recommend doing that so that's really all there is to using MSI X for desktop applications like WPF or wind forms the.net core versions alright now to give us a somebody you could put this on a server somewhere and point to this index.html page and allow them to run that and stall it run the installer and pull the write files so you'll just need to put this in a web server somewhere it's probably the ideal location for you if you're not gonna use the Microsoft Store now well I haven't covered today which is gonna come up in future videos at some point is publishing to the store there's an option there you saw me right click on it and say publish a Sochi app with a store we publish our application the first thing it asks us is do you want to put in a store so Store publishing is a little complex and it's more because not everything is documented well but once you get the process down you can put this in the Microsoft Store and actually sell your application now I'm gonna give you the source code so I would recommend you not put this when I store the store I understand the appeal this is an amazing application but probably won't sell very much especially since everybody has access to this source code but if you find the application that you build is useful for something you could put a store either for free or for a fee all right now that's one thing that will color cover the future but you could go from here with is the next step another thing is using a real certificate store so if you say you know what I don't want to mess around these dev certificates anymore I want us to have a real certificate you could do that I recommend going to komodo c om o te o they have a good reputation and they are not too expensive for code science difficut s-- but i do believe it's over $100 now for a code science get per year now you can use that certificate for more than one app so you could use it for multiple but again it's gonna cost you something every year so it's up to you if that investment is worth it at this point I recommend not doing that until there is a reason where that investment it's worth it don't create don't buy stuff first and then build your application build your application first and then buy the stuff as support like a website or code scientific 'its and so on now if you go through the store you'll work the store certificate process and that can be a little easier getting a an account for the Microsoft Store is not free either but they have made changes to it unlike with the like the Apple iOS applications where you pay per year for a developer license with the Microsoft Store for individuals I believe it's $19 to get a account and that's that's free from then on there's no more recurring fees so it's just $19 you get in the door just to say yes I'm serious essentially now the one other thing so that's published in the store korean certificates those are two things we haven't covered that I want to cover in a future video the third thing that it's it cannot at some point is automating all this so you've seen me right click and publish and create the app package that's okay but we really want to have us be an automated process where we use Azure DevOps or something similar to create automatically our packages for us and audit a push the store so that is something that would I recommend once you have your application design again it's not a first step thing the first step is getting your code running then get it packaged up then get it in the store and then after that then work on auditing the process so that it's repeatable its testable that it's not something that you have to go through a checklist in order to get done okay so those are the future things I think that you should you know next steps from this video okay but for now that's all right cover on MSA X you can use this to create installers for your winform application window form net or I'm sorry core your DPF core projects and even your youdo you P projects if you're doing those alright so with that if you have any questions leave them down in the comments below I will try to answer as best I can and maybe something else will have some answers as well alright thanks for watching and as always I am Tim quarry [Music] you
Info
Channel: IAmTimCorey
Views: 56,605
Rating: 4.9561315 out of 5
Keywords: msix packaging tool, msix, c# msix installer, wpf .net core, winforms .net core, msix desktop, visual studio 2019, .net core 3, iamtimcorey, tim corey, tim corey wpf, c#, msix desktop installer
Id: 4t2TI8ImwMY
Channel Id: undefined
Length: 58min 27sec (3507 seconds)
Published: Mon Feb 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.