Creating a Setup.exe file in Visual Studio - vb.net

I have looked around on many Youtube videos but I was not able to find a good one that made sense since they were either old or not clear in explaining it. So I decided to come here. I'm so sorry for my bad grammar and not being able to explain things too well.
I can't figure out on how to use "Microsoft Visual Studio 2015 Installer Projects" extension, since I do not know what are files to add into the "Application Folder" section. For the User Desktop, I am guessing it would be just a shortcut and the .ico file with it just excluded so the shortcut can have the icon with it also.
Thanks in advance,
Ryan

You can put your project output(.exe) and all of its .dll in the Application Folder. For the shortcut, you can set the application's icon on the application properties:
http://i.stack.imgur.com/5vtzz.png
Once you're finished, you can build the project. And you will see a installer on the installer project's debug folder.

See if this helps, it's old but still applies:
https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/

Related

In Visual Basic 2019, how do I set the installation directory for published projects?

I think this issue should have a simple solution. It should be a common desire of people programming using Visual Studio, but I have not been able to locate a solution to my problem, either in a book or online.
I am able to publish my visual studio project using the Publish Wizard. However, when I install the published program on my PC, the installation is deep in a maze of directories and inside a file with a bunch of random letters and numbers in its name. Here is where it installed:
C:\Users\Earl\AppData\Local\Apps\2.0\Z29TCPE5.944\RK99RK5P.J9K\basi..tion_71f32d96f76160a3_0001.0000_a14a9b8e58a3836c
I would like the installation to take place in the "C:\Program Files" directory so it is easy for the end user to locate and update the text files included with the program.
Is this possible? Seems like it should be easy to do. I am grateful for any help you could provide. Thank you in advance.

How do I compile vb code to exe?

I have some vb code that is structured like this:
./AssemblyInfo.vb
./WindowsApplication1/AppUtils.vb
./WindowsApplication1/Form1.vb
./WindowsApplication1.Form1.resx
./WindowsApplication1.My/MyApplication.vb
./WindowsApplication1.My/MyComputer.vb
./WindowsApplication1.My/MyProject.vb
./WindowsApplication1.My/MySettings.vb
./WindowsApplication1.My/MySettingsProperty.vb
./WindowsApplication1.My.Resources/Resources.vb
./WindowsApplication1.Resources.resx
./WindowsApplication1.vbproj
I have tried several times trying to create an empty solution and then import the .vb and the .vbproj but I can not stumble on the right combination to get it to expose the build button on the menu so we can build it.
I am not a windows person so googling is difficult because the terminology is difficult to understand: Example: I use the New Project button to create a solution; that is confusing.
In short, I am hoping to get instructions that will cover:
A) Creating a new solution,
B) Importing the code listed above into the solution, and
C) Compiling the code into an .exe.
BTW: I am using Visual Studio 2008.
If you give me you best guess I will edit your answer as I try it and figure out more precise instructions.
[EDIT] When I double click on the .vbproj file on windows explorer visual studio opens and the .vbproj file is displayed as XML. No build button is shown.
[EDIT] When I do File -> Open Project... .vbproj is not listed as a supported extension so there is no way to load the project from that menu item. That menu items does not have a *.* all source option. The .vbproj file has an icon that indicates that windows knows what it is: "Visual Basic Project file". This code is the result of a decompiling an .exe of the original project where the source was lost.
[EDIT] I just followed Joel's advice, but I used VS2005 rather than VS2008 and it was able to find the .vbproj file. Does that make sense? Is there something wrong with my VS2008 that makes it not open .vbproj files or is that to be expected?
[EDIT] The version of VS that CANNOT see the .vbproj is VS2008 9.0.30729.4462. The version of VS that CAN see the .vbproj is VS2005 8.0.50727.762. By "see" I mean when I follow Joel's instructions of using File->Open Project VS will recognize the .vbproj file as something it can open.
When I double click on the .vbproj file on windows explorer visual studio opens and the .vbproj file is displayed as XML
Something is broken with file associations on your Windows system.
You can open Visual Studio first and choose "Open Project/Solution" inside Visual Studio. Doing this will makes sure Visual Studio treats it as a project file, rather than just an XML file, and will allow you to attempt to build the project.
BTW, recent versions of Visual Studio are free. You might be able to fix this by updating to a more recent version.

How can I share an installer generated by Visual Studio?

I made a simple checklist desktop app in Visual Studio 2015, and I'm ready to share it with the world. Problem is that I don't know how to make an installer for it that I can share online. I have an installer exported, but it is Visual Studio's default ClickOnce installer, which won't work when I remove it from its original location
Is there a way I can package it so I can upload it somewhere and then share it? Do I need to code my own, or there some add-in or tool that will do it for me?
Once you have the installer extension this should help you to get started, as the name implies:
https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/
Have a look at this older post of mine:
What you can do,open the project as if going to edit it, just go to "Project" then "Publish(Whatever-your-work's-name-is).vb at the bottom. Then use the wizard to finish. At the end, say you saved your exe on the desktop, three files will appear.
"Whatever-your-work's-name-is".exe And its icon shape varies.
A folder called "Application Files"
And a "setup.exe" Its icon a like a CD on something.
For the first time, click on setup.exe and open the app. From then on, the "Whatever-your-work's-name-is".exe will open normally. I usually store all three on a zipped folder, which I upload on my website and can be downloaded from there.
To get a better example, vist my website.
I use this website to store my files for backup.
You can get the MS Installer extension from here... There's one for VS 2013 too.
(Credit to peterG for commenting this)

Visual Studio 2012 - Custom prerequisites are not appearing in the Properties > Prerequisites dialog box

I've created my first Office Add-in using Visual Studio. It targets the 4.0 .Net framework and was created using the new VS 2012. I need to distribute/install this project on various 32-bit XP and 64-bit Windows 7 computers around the office. So I configured the project to be installed on XP (which was my first speed bump because I didn't realize VS 2012 needed an update in order to make a solution that was XP compatible). Now that I have a valid win32 application, I am getting another error:
The following error occurred attempting to install 'C:\filepath...\Import Contacts.vsto':
"No application is associated with the specified file for this operation."
After doing some digging, I think I need to install the Microsoft Visual Studio Tools for Office Runtime on the client computer. To do this, I would like to use the prerequisites properties for the project. So I read up on creating custom prerequisites using some noteworthy sites (e.g, Creating Bootstrapper Packages, Application Deployment Prerequisites, Adding Custom Prerequisites, and Creating a Bootstrapper package for Office 2013 in Visual Studio 2012). I created the files according to that last URL (even though I'm not sure it pertains to the package I need just yet), but it is not appearing in the dialog box under Project > Properties > Publish > Prerequisites
If you read the article, it says the VS prerequisites dialog box should automatically update once I restart VS 2012, which I did but to no avail. I know I'll need to use this feature again in the future, so I would really like to know what I'm doing wrong and fix this. Please help! And I promise to quickly give the ACCEPT to whoever helps me fix this problem! Thank you in advance.
I didn't have any problems following the directions given in the web page and got the bootstrapper added to the Prerequisites dialog. However, there are plenty of possible ways to get it wrong. Some possibilities:
Triple-check the folder you added these files to. Be sure that you picked Program Files (x86) on a 64-bit version of Windows and not Program Files. And be sure that you now see the added VSTOR40 folder along with the other existing bootstrapper folders, like ReportViewer and VBPowerPacks.
You do not have write permission to this folder, UAC prevents copying files there. Be sure that you managed to copy them from, say, an elevated command prompt. Right-click the Command Prompt shortcut and click "Run as Administrator".
If you created the .xml files with Notepad then make sure you didn't accidentally saved them with the .txt extension. If necessary, put Explorer in "programmer mode" so you can see the filename extensions. Control Panel + Folder Options, View tab, untick the "Hide extensions for known file types" checkbox. If you now see product.xml.txt then rename the file to product.xml, same for package.xml.txt
If you created the .xml files with Notepad then be sure to save the file in UTF-8 encoding. File + Save As, Encoding combobox.
For all those who still may face similar issue I think that I found the cause of this issue. It seems that copying folder with custom bootstrapper package (and all necessary files in it) does not "refreshes" the list of available packages. Only when i went through this walkthrough and manually created folder in %Programfiles%\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ for sample package from this walkthrough my package has shown

VB.NET Debug Button Disabled

I am using Visual Studio Ultimate. I have made a fairly long program which worked fine.
One day I find that the debug button was disabled and both the build and rebuild buttons do not work. I have tried opening the same project files in Visual Basic Express 2010 but still, the sane problem.
I don't really want to have to reinstall but I'm not even sure that that will fix the problem. Thanks in advance.
Is there a startup project? One project in the Solution Explorer should be in bold. Right-click the executable project and select "Set as StartUp Project". Additionally, open the Project Properties, Application tab, and ensure Application type is either "Windows Forms Applications" or "Console Application".
Did you try to reset the setting of your Visual Studio Ultimate?
Type: (In your visual studio command prompt)
devenv /resetsettings
Buttons disabled for just that program, or all programs?
I vaguely remember having a similar problem many years ago. Re-creating the project and solution files fixed it, I think (ie. create a new solution/project and import all the .vb files).
Another thing to check would be whether the compiled files have become read-only. Maybe VB.NET can't delete the old .EXEs
You need to build a test application. I think thats more difficult then making the application itself. In my personal opinion, your better off building the whole software in a notepad.
http://msdn.microsoft.com/en-us/library/ms182532.aspx