Solved

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

Posted on 2014-01-10
15
15 Views
Last Modified: 2016-07-10
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
thanks,
0
Comment
Question by:josephh610
  • 5
  • 5
  • 2
15 Comments
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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.
0
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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.
0
 

Author Comment

by:josephh610
Comment Utility
But once you create the installation package, how do you then add/update files to it from a command line?
0
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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.
0
 

Author Comment

by:josephh610
Comment Utility
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.
0
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
Yes, you can compile an .exe or a .dll with command line switches. This is from the MSDN under Command Line Arguments:

"Syntax

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]"

and

"/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.
0
 

Author Comment

by:josephh610
Comment Utility
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?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 360 total points
Comment Utility
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.
0
 

Author Comment

by:josephh610
Comment Utility
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.
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 360 total points
Comment Utility
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 (http://www.bing.com/search?q=clickonce%20fpt&FORM=BBMULB&PC=BBMU&QS=n), you will see that a lot of programmers seem to have find workarounds. I have no ideat however on how well it works.
0
 

Author Comment

by:josephh610
Comment Utility
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now