Is there a way to insert a file (dll) into a vb.Net setup project from command line?

Is there a way to insert a file (dll) into a vb setup solution/project from command line?

I have a vb  solution with a setup project in it and I need to update a dll in that setup project from the command line. so when I compile it will reflect the updated dll.
let me know
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
If you want to do that, you cannot do it simply from a command line. You need an application that can open the .msi file and recreate it.

And even doing so, you would probably end up with problems, because the reference compiled into your application would probably not match the updated dll.

Your best bet is to recompile the application with the updated dll and recreate the setup project.
VB6 comes with a Package and Deployment Wizard which creates an installation package comprising a set-up program and the necessary files. The user can specify extra files that the Wizard doesn't add automatically.
josephh610Author Commented:
But once you create the installation package, how do you then add/update files to it from a command line?
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Jacques Bourgeois (James Burger)PresidentCommented:
You don't. You create a new package.

The package comes in the form a .msi file. Just as you cannot modifiy a .exe without recompiling it, you cannot modify a .msi without recreating it.

If you could explain more in detail what you want to "update" in the installation, maybe we could help you.
josephh610Author Commented:
I have a dll which is part of the setup project. The included dll gets updated from time to time. So i would like an easy way from the command line to recompile the solution/project with the newly added dll.
Jacques Bourgeois (James Burger)PresidentCommented:
First of all, something I did not catch when I first read your question: "a vb6 setup solution/project". The notion of a solution did not exist in VB6. And VB6 did not have a Setup Project, it used as Wizard to prepare setups. Are you sure that you are in VB6 and not VB.NET? Both use different ways of preparing setups and updates.

"The included dll gets updated from time to time" if it's only from time to time, then recompiling and creating a new setup manually takes only a few minutes, while creating a command line compile is a lot of work prone to errors and omissions. And this, no matter if you are in VB6 or VB.NET.

If you are in .NET however, and especially if this is for an application that is deployed in-house, then you might consider a ClickOnce deployment over a Setup deployment. This is the easiest way to do what you want to do, and a new update is prepared with only the click of a button, making it even easier than creating a script that can be called from a command line.
Yes, you can compile an .exe or a .dll with command line switches. This is from the MSDN under Command Line Arguments:


vb5[.exe] [[{/run | /r} projectname] [[{/d compileconst}] {/make | /m } projectname] [{/makedll | /l} projectname] {/cmd argument | /c argument}][{/runexit} projectname][{/m} or {/runexit} projectname /out filename}][{/m}][/sdi] or [/mdi]"


"/makedll or /l Tells Visual Basic to compile projectname and make an in-process ActiveX server (.dll) file from it. "

You could run that in a .bat file or a VBScript snippet and then distribute the dll on its own.
However, how would the source code editing be done? You would still have to open an editor, which might as well be VB6.

Note that, VB6 has a Project Group (.vbg) which does the more or less the same as a Solution in .net.
josephh610Author Commented:
It turns out I am using:
Microsoft (R) Visual Studio Version 8.0.50727.42.
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.

Does that make a difference?
Jacques Bourgeois (James Burger)PresidentCommented:
Then you are in VB.NET, not in VB6, so disregard anything that has been said about VB6.

As I hinted earlier, in VB.NET, especially for in-house updates, ClickOnce is usually a lot easier to use than a setup program and has everything that you want.

You prepare a ClickOnce deployment throught the Publish tab of the project's Properties window. It's easy to set up for the first deployment. By default, the users will install the application through a web or intranet site, but it can be configured to install from a network drive.

When you have an update to distribute, you simply make sure to increase the Publish version number and click on Publish. That is all. That is all for the users too. They won't even have to go back to the deployment location. By default, the next time they will start their application, they will be told that there is a new version and asked if they want it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
josephh610Author Commented:
Will ClickOnce work with external customers that only have an ftp site as they have protected environments? It sounds like a great solution however not sure if would work for our purposes. We usually just ftp the setup and let there IT install at will.
Jacques Bourgeois (James Burger)PresidentCommented:
By default no.

I have used it with CDs, http and network drives, but have never encountered ftp in the documentation or the standard mechanisms.

However, if you do a quick search (, you will see that a lot of programmers seem to have find workarounds. I have no ideat however on how well it works.
josephh610Author Commented:
What about updating the metadata in the solution file with the updated file path information and then building?
I noticed you can open a solution file and see all the files listed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.