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
28 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
15 Comments
 
LVL 40
ID: 39773383
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
ID: 39775549
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
ID: 39775556
But once you create the installation package, how do you then add/update files to it from a command line?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40
ID: 39775572
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
ID: 39775588
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
ID: 39775624
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39776275
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
ID: 39777317
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
ID: 39777578
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
ID: 39777718
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
ID: 39777800
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
ID: 39816130
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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