locked
Silent console app? RRS feed

  • Question

  •  

    I have a very small console app. I just want it to run and no flash at all. I found a couple of ways do this, but I can't seem to get it to work.

    Code Snippet

    Sub Main()

    Shell("D:\PVAT\setup.exe", AppWinStyle.Hide)

    Dim fileExists As Boolean

    fileExists = My.Computer.FileSystem.FileExists("C:\Program Files\PVAT\0229.exe")

    If fileExists = False Then

    System.Diagnostics.Process.Start("D:\PVAT\setup.exe")

    End If

    End Sub

     

     

     

    Where am I going wrong?

     

    Thanks!

     

    Rudy

    Thursday, March 13, 2008 3:32 PM

Answers

  •  Rudemusik wrote:

    I have a very small console app. I just want it to run and no flash at all. I found a couple of ways do this, but I can't seem to get it to work.

     

    Hi Rudy,

     

    To get rid of the flash effect, here are two suggestions:

     

    1. Keep your console project code unchanged, change it to Windows Forms Application type like this:

    Project menu -> Properties -> Application tab -> Application type

    Code Snippet

     

    Module Module1

     

        Sub Main()

            Shell("D:\PVAT\setup.exe", AppWinStyle.Hide)

            Dim fileExists As Boolean

            fileExists = My.Computer.FileSystem.FileExists("C:\Program Files\PVAT\0229.exe")

            If fileExists = False Then

                System.Diagnostics.Process.Start("D:\PVAT\setup.exe")

            End If

        End Sub

     

    End Module

     

     

    2. Create Windows Forms Application instead of the Console Application.

    Code Snippet

    Public Class Form1

     

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

     

            Me.Hide() ' Hide form

     

            Shell("D:\PVAT\setup.exe", AppWinStyle.Hide)

            Dim fileExists As Boolean

            fileExists = My.Computer.FileSystem.FileExists("C:\Program Files\PVAT\0229.exe")

            If fileExists = False Then

                System.Diagnostics.Process.Start("D:\PVAT\setup.exe")

            End If

     

        End Sub

     

    End Class

     

    If I misunderstood you, please clarify your question further. 

     

    Regards,

    Martin

    Wednesday, March 19, 2008 10:10 AM
  •  Rudemusik wrote:

    Thanks for the suggestion.  I have a program that is written in VS 2008, vb.net.  This program is working with an other program, built in Wonderware, a windows based developer program.  When this other program starts, I need to install my application silently.  There is a check to see if the program is installed, then it will cease the install, and with all the user prompts off.  I still get a small flash during the check or install.  I need it to be completly seamless.

     

    Hi Rudy,

     

    You can create your application as a Silent Installation package (without user interaction) using several tools:

     

    1. Using Wix (Windows Installer XML) to automate your build process to create MSI file.

    MSI insatallation package supports unattended application installation: Installation packages can be configured to require no installation process interaction from the user. During the installation process, Windows Installer can query the computer for desktop attributes, including determining whether any applications were previously installed by Windows Installer.

    http://www.askdavetaylor.com/how_do_i_install_a_msi_windows_download.html

     

    2. Using Setup Factory 5.0 to create a Silent Installation package.

       http://www.indigorose.com/forums/showthread.php?t=5384

     

     

    If you mean making a background installation package so that it can be installed at the background unconsciously, that may be related to hacker technology, or you can play with the following tools to try creating own installation package.

     

     

    ClickOnce and Setup & Deployment Projects forum is here:

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=6&SiteID=1

     

     

    Best regards,

    Martin

    Thursday, March 20, 2008 4:13 AM

All replies

  •  Rudemusik wrote:

    I have a very small console app. I just want it to run and no flash at all. I found a couple of ways do this, but I can't seem to get it to work.

     

    Hi Rudy,

     

    To get rid of the flash effect, here are two suggestions:

     

    1. Keep your console project code unchanged, change it to Windows Forms Application type like this:

    Project menu -> Properties -> Application tab -> Application type

    Code Snippet

     

    Module Module1

     

        Sub Main()

            Shell("D:\PVAT\setup.exe", AppWinStyle.Hide)

            Dim fileExists As Boolean

            fileExists = My.Computer.FileSystem.FileExists("C:\Program Files\PVAT\0229.exe")

            If fileExists = False Then

                System.Diagnostics.Process.Start("D:\PVAT\setup.exe")

            End If

        End Sub

     

    End Module

     

     

    2. Create Windows Forms Application instead of the Console Application.

    Code Snippet

    Public Class Form1

     

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

     

            Me.Hide() ' Hide form

     

            Shell("D:\PVAT\setup.exe", AppWinStyle.Hide)

            Dim fileExists As Boolean

            fileExists = My.Computer.FileSystem.FileExists("C:\Program Files\PVAT\0229.exe")

            If fileExists = False Then

                System.Diagnostics.Process.Start("D:\PVAT\setup.exe")

            End If

     

        End Sub

     

    End Class

     

    If I misunderstood you, please clarify your question further. 

     

    Regards,

    Martin

    Wednesday, March 19, 2008 10:10 AM
  • Hi Martin!

     

    Thanks for the suggestion.  Let me lay out the bigger picture.  I have a program that I wrote , that is working with another program, not made with visual studio.  When this other program starts, I want to install my program.  Now there is a condition that it will check if there is a program there, if it is, it won't install. But during the install program, with all of the user interface prompts off, it still flashes a screen for a second.  I need it so there is no way the user knows it's checking to install, or install my program. I'm using VS 2008, and the other program is written in Wonderware.

     

    I would just like it to look seamless to the end user.  Any other suggestion?

     

    Thanks!

     

    Rudy

     

    Wednesday, March 19, 2008 1:19 PM
  • Hi Martin!

     

    Thanks for the suggestion.  I have a program that is written in VS 2008, vb.net.  This program is working with an other program, built in Wonderware, a windows based developer program.  When this other program starts, I need to install my application silently.  There is a check to see if the program is installed, then it will cease the install, and with all the user prompts off.  I still get a small flash during the check or install.  I need it to be completly seamless.

     

    Any other ideas?

     

    Thanks!

     

    Rudy

     

    Wednesday, March 19, 2008 1:24 PM
  •  Rudemusik wrote:

    Thanks for the suggestion.  I have a program that is written in VS 2008, vb.net.  This program is working with an other program, built in Wonderware, a windows based developer program.  When this other program starts, I need to install my application silently.  There is a check to see if the program is installed, then it will cease the install, and with all the user prompts off.  I still get a small flash during the check or install.  I need it to be completly seamless.

     

    Hi Rudy,

     

    You can create your application as a Silent Installation package (without user interaction) using several tools:

     

    1. Using Wix (Windows Installer XML) to automate your build process to create MSI file.

    MSI insatallation package supports unattended application installation: Installation packages can be configured to require no installation process interaction from the user. During the installation process, Windows Installer can query the computer for desktop attributes, including determining whether any applications were previously installed by Windows Installer.

    http://www.askdavetaylor.com/how_do_i_install_a_msi_windows_download.html

     

    2. Using Setup Factory 5.0 to create a Silent Installation package.

       http://www.indigorose.com/forums/showthread.php?t=5384

     

     

    If you mean making a background installation package so that it can be installed at the background unconsciously, that may be related to hacker technology, or you can play with the following tools to try creating own installation package.

     

     

    ClickOnce and Setup & Deployment Projects forum is here:

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=6&SiteID=1

     

     

    Best regards,

    Martin

    Thursday, March 20, 2008 4:13 AM
  • Pefect!  Alot of options.

     

    Thanks for the info Martin!

     

    Rudy

    Friday, March 21, 2008 3:55 PM