{"id":1943,"date":"2017-10-02T22:19:45","date_gmt":"2017-10-02T22:19:45","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=1943"},"modified":"2022-02-03T11:24:28","modified_gmt":"2022-02-03T17:24:28","slug":"c-installer-visual-studio","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/","title":{"rendered":"Using Visual Studio to Create a C# installer"},"content":{"rendered":"<h2>C# Installer Intro:<\/h2>\n<p>This is a more complete list of all of the different processes you might want to have in an installer for c# in visual studio 2017. I have collected this data from across several different people on the internet but there seems to be no complete list anywhere so here you go. First thing is that if you want a free installer, what you have to do is to look for something called setup project. Here is a link to the download. <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects\">https:\/\/marketplace.visualstudio.com\/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects<\/a><\/p>\n<h1>Step By Step Guide<\/h1>\n<h3>initial setup<\/h3>\n<p>#1: Make sure that the download is installed. Simply double click on the download<\/p>\n<p>#2: Open Visual Studio and open the solution that you want to add an installer to. Then right click on the solution itself within your solution explorer, then <strong>Add<\/strong>, then <strong>New Project. <\/strong>A frame will pop up called <em>Add New Project<\/em>. From here I recommend <em>Setup Project<\/em>. Though you could use the Wizard, you will learn more just doing each part on your own. Make sure you name it before pressing OK. It is now a good idea to open the properties of the setup project and change the author and manufacturer. This affects the folder names that it will be stored in.<\/p>\n<h3>Get your files to load<\/h3>\n<p>#3: Now you should have a screen that says File System come up. If not, don&#8217;t worry all you have to do is right click on your newly created setup project, go to view and then File System. From here you can access the different things you might want to modify when your installer runs. Application Folder represents the actual folder that will be created and filled with your source files. the other two are fairly self explanatory as the users desktop and programs menu.<\/p>\n<p>#4: Now you need to choose what files you want to add to your installer. Right click on application folder and Add. From here you have three options. Folder, project output, file, or assembly.\u00a0 Project output is a good option because it auto-detects what is in your C# code and finds a way to insert what is need into your installer. If, however, you have additional files that you wish to add, you can choose either folder, or files. These will come in handy later.<\/p>\n<p>#5: As for the Desktop and programs menu. If you want you can add a shortcut to either of these. If your program is an exe file and it needs to be run then this is a good option.<\/p>\n<h3>Setting up the files that you have<\/h3>\n<p>#6: It is wise to set up any dlls or other assemblies to be in the proper format. In my particular case I was using COM dlls and so i had to make sure that they were registered correctly. In order to do this I set the Register to vsdrfCOM. I was unable to figure out exactly how to get registry to work for these direct from the installer. As a result I was forced to build a program to do it for me and add it as part of the installation.\u00a0 Update to come If I do figure it out.<\/p>\n<h3>Adding an executable to the installation process<\/h3>\n<p>#7: You may, as I did, wish to add an executable to your installation process. It is not to hard to do so. First, right click on your setup project in the solution explorer. Go to view, then custom actions. From here you can choose an executable to be an element of your install.<\/p>\n<p><a href=\"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-medium wp-image-1944\" src=\"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png\" alt=\"\" width=\"300\" height=\"279\" srcset=\"https:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png 300w, https:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1.png 306w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>For each of the four folders you are going to right click and then choose add custom action. Here is where the file or folder options from step #4 will come in handy. You can only select an executable from the files you are installing which should make sense because you cant be sure that file will be located in your destination. Select the file you wish to use from the application folder.\u00a0 Next, open the properties for the newly created custom action. Change the\u00a0 Installer class field to false. Once this is done your executable will perform the desired program on install.<\/p>\n<p>In order to make sure that the the installer will overwrite older versions of the installed program. and so follow these steps to make sure that it installs properly.<\/p>\n<ol>\n<li>Set Remove Previous Installation as True<\/li>\n<li>Set Detect new version as True<\/li>\n<li>Your C# program&#8217;s version must increase with every deployment<\/li>\n<li>You should change version of your installer to one higher version and it will ask you to change product code, select YES.<\/li>\n<li>Do not change your upgrade code, let it be same.<\/li>\n<\/ol>\n<p>https:\/\/stackoverflow.com\/questions\/3024753\/installing-a-new-version-of-a-deployment-project-over-old-version<\/p>\n<h3>Conclusion<\/h3>\n<p>At this point your installer should build your C# program on a new windows platform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C# Installer Intro: This is a more complete list of all of the different processes you might want to have in an installer for c# in visual studio 2017. I have collected this data from across several different people on the internet but there seems to be no complete list anywhere so here you go. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1943","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"C# Installer Intro: This is a more complete list of all of the different processes you might want to have in an installer for c# in visual studio 2017. I have collected this data from across several different people on the internet but there seems to be no complete list anywhere so here you go. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-02T22:19:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:24:28+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png\" \/>\n<meta name=\"author\" content=\"Etienne Bley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Etienne Bley\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"Using Visual Studio to Create a C# installer\",\"datePublished\":\"2017-10-02T22:19:45+00:00\",\"dateModified\":\"2022-02-03T17:24:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/\"},\"wordCount\":807,\"image\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/elbsolutions.com\\\/projects\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Capture1-300x279.png\",\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/\",\"name\":\"Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/elbsolutions.com\\\/projects\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Capture1-300x279.png\",\"datePublished\":\"2017-10-02T22:19:45+00:00\",\"dateModified\":\"2022-02-03T17:24:28+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#primaryimage\",\"url\":\"http:\\\/\\\/elbsolutions.com\\\/projects\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Capture1-300x279.png\",\"contentUrl\":\"http:\\\/\\\/elbsolutions.com\\\/projects\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Capture1-300x279.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/c-installer-visual-studio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Visual Studio to Create a C# installer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\",\"name\":\"ELB Solutions.com Inc.\",\"description\":\"Bringing all your IT Pieces together\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\",\"name\":\"Etienne Bley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"caption\":\"Etienne Bley\"},\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/author\\\/etienne-bley\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/","og_locale":"en_US","og_type":"article","og_title":"Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.","og_description":"C# Installer Intro: This is a more complete list of all of the different processes you might want to have in an installer for c# in visual studio 2017. I have collected this data from across several different people on the internet but there seems to be no complete list anywhere so here you go. [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2017-10-02T22:19:45+00:00","article_modified_time":"2022-02-03T17:24:28+00:00","og_image":[{"url":"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png","type":"","width":"","height":""}],"author":"Etienne Bley","twitter_misc":{"Written by":"Etienne Bley","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"Using Visual Studio to Create a C# installer","datePublished":"2017-10-02T22:19:45+00:00","dateModified":"2022-02-03T17:24:28+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/"},"wordCount":807,"image":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#primaryimage"},"thumbnailUrl":"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png","articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/","url":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/","name":"Using Visual Studio to Create a C# installer - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"primaryImageOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#primaryimage"},"image":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#primaryimage"},"thumbnailUrl":"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png","datePublished":"2017-10-02T22:19:45+00:00","dateModified":"2022-02-03T17:24:28+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#primaryimage","url":"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png","contentUrl":"http:\/\/elbsolutions.com\/projects\/wp-content\/uploads\/2017\/10\/Capture1-300x279.png"},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/c-installer-visual-studio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"Using Visual Studio to Create a C# installer"}]},{"@type":"WebSite","@id":"https:\/\/elbsolutions.com\/projects\/#website","url":"https:\/\/elbsolutions.com\/projects\/","name":"ELB Solutions.com Inc.","description":"Bringing all your IT Pieces together","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elbsolutions.com\/projects\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39","name":"Etienne Bley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","caption":"Etienne Bley"},"url":"https:\/\/elbsolutions.com\/projects\/author\/etienne-bley\/"}]}},"_links":{"self":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/comments?post=1943"}],"version-history":[{"count":5,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1943\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1943\/revisions\/1952"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=1943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=1943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=1943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}