Code Comments
Programming Forum and web based access to our favorite programming groups.I have created a Setup Project using Visual Basic .NET. I have no problem to create an installer copying my .exe into a specific dir ectory and also to write into registries. BUT I don't know how can I read command line arguments. I must absolutely read the command line arguments and use this arguments for my installation. Does anyone have an idea? Thanks a lot Trinidad.
Post Follow-up to this messageI'm not sure what you mean - the exe is a wrapper generated by Visual Studio, and I don't know if you can pass command line arguments into it that you can use. If you just create an MSI file, you can run it with a command line such as: msiexec /i <path to your msi> MYPROPERTY=something and then the property MYPROPERTY can be referenced during the setup, in conditions for installing files etc. -- Phil Wilson [Microsoft MVP-Windows Installer] Definitive Guide to Windows Installer http://apress.com/book/bookDisplay.html?bID=280 "Trinidad" <Trinidad.1iafto@mail.codecomments.com> wrote in message news:Trinidad.1iafto@mail.codecomments.com... > > I have created a Setup Project using Visual Basic .NET. > I have no problem to create an installer copying my .exe into a > specific directory and also to write into registries. > BUT I don't know how can I read command line arguments. > I must absolutely read the command line arguments and use this > arguments for my installation. > > Does anyone have an idea? > > Thanks a lot > Trinidad. > > > > -- > Trinidad > ------------------------------------------------------------------------ > Posted via http://www.codecomments.com > ------------------------------------------------------------------------ >
Post Follow-up to this messageThe problem is my Setup.exe will be called from another existing application . This application will call "Setup.exe param1" and I cannot change the way th is application will call my Setup.exe. I will like to know if there is a way to read this entry parameter (param1) into my Setup program. Is there something I can change with a Custom Action? The only solution I have found until know is to use an intermediary project that will analyze the command line parameter and save it into a registry. Th en this project calls the Setup.exe without parameters. Into the Setup project I add a Custom Action reading the parameter stored in to the registry and then making the needed actions. Do you think this is a good and only solution? Thank you very much for your help Trinidad Martinez.
Post Follow-up to this messageTO get command line arguments in .net use the command function This example uses the Command function to return the command-line arguments in an object containing an array. Function GetCommandLineArgs() As String() ' Declare variables. Dim separators As String = " " Dim commands As String = Microsoft.VisualBasic.Command() Dim args() As String = commands.Split(separators.ToCharArray) Return args End Function
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.