Using Visual Studio to Create a C# installer

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. 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. https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

Step By Step Guide

initial setup

#1: Make sure that the download is installed. Simply double click on the download

#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 Add, then New Project. A frame will pop up called Add New Project. From here I recommend Setup Project. 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.

Get your files to load

#3: Now you should have a screen that says File System come up. If not, don’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.

#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.  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.

#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.

Setting up the files that you have

#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.  Update to come If I do figure it out.

Adding an executable to the installation process

#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.

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.  Next, open the properties for the newly created custom action. Change the  Installer class field to false. Once this is done your executable will perform the desired program on install.

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.

  1. Set Remove Previous Installation as True
  2. Set Detect new version as True
  3. Your C# program’s version must increase with every deployment
  4. You should change version of your installer to one higher version and it will ask you to change product code, select YES.
  5. Do not change your upgrade code, let it be same.

https://stackoverflow.com/questions/3024753/installing-a-new-version-of-a-deployment-project-over-old-version

Conclusion

At this point your installer should build your C# program on a new windows platform.

Share Button

Upload Keynote to WordPress Example (Nevada and Idaho 2017)

Click Continue Reading for … welll more on how to do it. It takes about 5 minutes once you have done it once. Continue reading

Share Button

Signing .net VS Manifests driving me nuts. Finally a solution.

This worked for me finally. https://stackoverflow.com/a/8341110

Share Button

Planning a rafting trip – not technical but lets not lose the details

There are so many little steps to keep people safe etc. that I didn’t want to lose sight of theses instructions. Also- it is very  useful for others to know. So, whey not blog here about it and help others along. This was made withe  good advise of tall the moms and dads on the trip and one of them is a rafting enthusiast 🙂

Preplanning

Continue reading

Share Button

VBA Selection Set optimization

For some reason, I have never really understood the whole filtered selection sets – it was actually some syntax issues. If you don’t pass the correct types into SS.Select … things go very wrong. Here is some code that works.  Note that ClearSelectionSet merely pre-deletes the named selection set. A useful links to shed some light on dxf codes is here. Here is the main article that solved my dilemna, I copied and pasted it and it worked – why didn’t mine? Not sure – need to get on with life. 🙂 . Continue reading

Share Button

Automating “Command line only” operations in AutoCAD – some tips

Over the past 6 months, I have had to resort to command line options for plugins from CadWorx and others. The one was 2DREPH and I wanted to do it on X viewports. I had these viewports in an array, but how can I make a command line string that would consistently work? Well, it came down to making a selection set, then making a group with the same name (prefixed with lets say “GRP”), then using the commandline selection based on group. So, for instance, when prompted for objects here is a selection example:

“SELECT G GRPMYFAVGROUP  ” (note the 2 spaces at the end)

Handy. I then deleted the group to put things back to the way they were.Why? Well… Continue reading

Share Button

Run VBA From AutoCad’s Command Prompt vbastmt

Well if that isn’t handy. Use ‘vbastmt’ on the command line and put VBA with its in-line separator (colon) and bob’s ur uncle. Click here for source.

Share Button

How to show a random selected entity’s AutoCad Handle

I am a little tired of looking for this so I thought I would copy it here. Here is the source.

Continue reading

Share Button

AutoCad XData Organization And Refresher – CadWorx

So I am working with CadWorx. I needed a refresher on my Autocad XData – I suspected that is where the data was stored as CadWorx files seem to have a 3D shape and a line grouped together … but why? Well, the line had XDATA attached to it was my suspicion and I was right. Here are some links that I found helpful to get me re-oriented after 4 years of needing this info …

Share Button

Restful Service Help

Here are some websites with tips on how to make Restful Services.

https://closebrace.com/tutorials/2017-03-02/the-dead-simple-step-by-step-guide-for-front-end-developers-to-getting-up-and-running-with-nodejs-express-and-mongodb

Share Button