Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ghostscript silent install

Posted on 2010-09-13
3
Medium Priority
?
2,018 Views
Last Modified: 2013-11-13
From the run dialog, the following works just as intended:
"D:\HPFFA Solution\HPF_Forms_Assistant Solution\HPF_Forms_Assistant Solution\HPF_Forms_Manager\setupgs.exe"  "%ProgramFiles%\gs"

The free ghostscript program is quietly installed on the user's machine.

However, when I use the code attached from within my vb.net winforms program (in debug mode), the installation program fails saying it cannot copy the gsdll32.dll file to the Program Files destination.     If I run "D:\HPFFA Solution\HPF_Forms_Assistant Solution\HPF_Forms_Assistant Solution\HPF_Forms_Manager\setupgs.exe"  "%ProgramFiles%\gs" while my winforms program is open, it still works as expected.

Any ideas, suggestions, would be greatly appreciated.

Public Function InstallGhostScript() As Boolean
        Dim retval As Boolean = True
        Dim str_base_dir As String = ""
        Dim inst_gs As Process = Nothing
        Dim str_run As String = ""

        Dim pinfo As ProcessStartInfo = Nothing

        Dim str_dest_dir As String = Nothing


        Try
            str_base_dir = System.AppDomain.CurrentDomain.BaseDirectory()
            str_run = str_base_dir & "setupgs.exe" & Space(1) & Chr(34) & "%ProgramFiles%\gs" & Chr(34)
            pinfo = New ProcessStartInfo
            pinfo.FileName = str_base_dir & "setupgs.exe"
            pinfo.WorkingDirectory = str_base_dir
            pinfo.Arguments = "%ProgramFiles%\gs"
            frm.Cursor = Cursors.WaitCursor
            ShowMessage("Please wait...installing conversion utility", MessageAlert.MyMessageType.information)
            Application.DoEvents()
            inst_gs = Process.Start(pinfo)
            inst_gs.WaitForExit()
            frm.Cursor = Cursors.Default

        Catch ex As Exception
            retval = False
            lex.Message = ex.Message


        Finally
            frm.Cursor = Cursors.Default

        End Try

        Return retval
    End Function

Open in new window

0
Comment
Question by:codefinger
  • 2
3 Comments
 
LVL 21

Expert Comment

by:chapmanjw
ID: 33664409
Have you tried this while running your application as Administrator?  (Right-click your executable, Run As Administrator)
0
 

Author Comment

by:codefinger
ID: 33665913
"Have you tried this while running your application as Administrator?  (Right-click your executable, Run As Administrator)"

Good suggestion,  so I tried it but it did not help.

0
 

Accepted Solution

by:
codefinger earned 0 total points
ID: 33666837
Never mind.  After Googling most of the day, I found another ghostscript install program that is a lot more straightforward, is silent, and works just the way I need it to.....


http://www.matthanson.ca/2009/08/silently-install-cutepdf-writer-and-ghostscript/

0

Featured Post

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!

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

885 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