VASmalltalk – Finding Ghostview Installation

If you ever have to work with the Windows Registry under VASmalltalk consider buying the Registry Library. It worth its price without even thinking about it.

Here the simple source to get the path of the gsprint.exe tool, which is needed to print a pdf file to a Windows printer:

| registryNode registryNodeKeys versionKey baseDirectory |
	
registryNode := RegistryNode 
                    localMachineSubNodeName: 'Software\Ghostgum\Gsview'.
registryNode exists ifFalse:[ ^nil ].
	
(registryNodeKeys := registryNode keys asOrderedCollection) isEmpty 
   ifTrue:[ ^nil ].
versionKey := registryNodeKeys first.

(baseDirectory := registryNode at: versionKey ifAbsent:[ nil ]) isNil 
   ifTrue:[ ^nil ].
	
^baseDirectory,'\gsview\gsprint.exe'
This entry was posted in Smalltalk and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s