Linking an .exe file in vb.net project - vb.net

I'm working on a VisualBasic project (its my first), and I wanted to ask:
How can I link an .exe file with the project?
Example: When the user opens the project, the .exe file also opens.
Easy I think (I'm newbie!)

To start another application in your application, use Process.Start
Example:
Process.Start("C:\MyApplication.exe")
I hope it will help you.

Related

How to compile .vb files into exe with visual studio community?

So I got a crypter project from Github and I need help with it. Simply for the fact that I have no clue what I am doing when it comes to visual studio code and I need help with it. So below I have attached some pictures so you guys kinda understand the goal of what I am trying to achieve is (Building an exe file from .vb files).
img1
img2
Here I have opened the loadme.vb file
img3
I went to the build section and it is greyed out :(
img4
Like I said I have no clue what I am doing and I just want to take these .vb files from a project on Github and compile them into a simple .exe file to be executed.
Building .NET code in VS requires a project file. For VB, that's a file with extension .vbproj.
To do this, I suggest you create a new VB .NET project via File | New | Project... and selecting .NET Console Application with language VB.
Once you have a project, you can add the .vb source files to it by copying them into the project folder.
Then you just need to build the project.

How do I create an .exe file in Visual Studio?

I cant wrap my head around this. If I try to build I just get a dll, but I want a exe!
If you have created a project using type Class Library, you will get a dll. Try creating a new project of type, for example, Windows Form App. When you compile it, you will end up with an exe file.
The Microsoft documentation has all the info you need.
Try using "Advanced Installer" to create a .exe or .msi installer that creates a .exe launcher. I hope this helped!

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)

Publish WinForm that uses .dll in one file

How can you publish a WinForm that uses a .dll extension into one .exe file? I'm using VB.NET on Visual Studio 2013.
I have tried several methods such as using only the program .exe file from both the Debug and Release folder but these didn't work in isolation - a runtime error happened every time a command from the extension was used, as if it didn't exist.
My problem is packaging the entire program into one file. I don't want to have to use ClickOnce applications because you can't use a custom logo and so it kinda looks bad. I'll use it if there's no alternative.
I realised that the answer was to use the setup.exe file when publishing. Also, changing the logo of a ClickOnce program is possible.

Deploying VB.NET program can't find dlls in same folder

I wrote a program in VB.NET which uses several .dlls that I programed in c++. The dlls wrap some functions from an old version of the program. On my development computer everything works fine but I build a release version, copy it and the dlls onto the target machine and the .exe starts up fine. When the program tries to use a function from the .dll it throws an exception and says "unable to load DLL "c:/the path/my.dll" the specified module can't be found."
I don't know if it makes any difference, but I am defining the dll functions in the main vb project using:
Declare Function MyFunction Lib "c:/the path/my.dll" (ByVal in1 as Double, ByRef out1 as Double) as Integer
I have checked the .net framework on the target and version 4 seems to be installed same as the development computer. Both are windows XP machines. I have no idea if it is the way I programmed the .dlls or just something with my vb.net project. Any help is appreciated.
Use a path relative to your executable, rather than an absolute path.
Or, even better, don't use the path at all and just list the name of the dll file. Then add the dlls as resources to your project. You should then be able to easily bundle the inside your setup project and they'll automatically end up in the right place for both debugging and deployment.
If I am not mistaken, you want your application to function with all the .dll files you used and worked on your machine. The simplest thing to do is to publish your Program or application. But first, you have to follow the following steps in order to include all the .dll files that you want your published program to use.
Click the Project tab and select the Add References… menu.
from the opened new window, use the Browse… tab to locate the files you want to add to your project, then click Add.
Then from the project menu, select your project property: for example, if your project is named Johns_App, then in the project tab, you will find Johns_App Properties. Click this, and it will take you to a new window.
In this new window, click the Publish tab, then from the Application Files… tab, you can check, include, and exclude the project files. Then you are all set.
I suggest using the Publish Wizard…, as it will guide you step by step.
Hope this helps
Found a link to a CodeProject page which referenced this same problem.
Basically you need to check that all dependencies of the DLL file(s) are available in the running location. Using the Microsoft Dependency Walker led me to the solution that one of the dll files used in my VB application was referencing a different dll file. After placing that other DLL with other run files no more error!