Greenshot

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Greenshot is a open-source screen capture utility available at http://getgreenshot.org/

Greenshot 1.1[edit]

If you used the 1.0 Greenshot package previously listed here, know that this one adds 32-bit installation support and will copy default settings to the %APPDATA% folder.

<package
        id="greenshot"
        name="Greenshot"
        revision="%version%"
        priority="5"
        reboot="false">
        <variable name="fileversion" value="1.1.5.2643" />
        <variable name="version" value="1.1.5.2643" />
        <check type="uninstall" condition="exists" path="Greenshot %version%" />

        <commands>
                <command type="install" cmd='"%SOFTWARE%\greenshot\Greenshot-INSTALLER-%fileversion%.exe" /LOADINF="%SOFTWARE%\greenshot\greenshot.inf" /VERYSILENT /NORESTART /NORUN' />
                <command type="install" cmd='%comspec% /c copy %SOFTWARE%\greenshot\Greenshot-defaults.ini "%APPDATA%\Greenshot\Greenshot-defaults.ini"' />

                <command type="upgrade" include="install" />

                <command type="remove" architecture='x86' cmd='"%PROGRAMFILES%\Greenshot\unins000.exe" /SILENT'>
                        <exit code="1" /> <!-- Returns 1 even when uninstall succeeds -->
                </command>
                <command type="remove" architecture='x64' cmd='"%PROGRAMFILES(x86)%\Greenshot\unins000.exe" /SILENT'>
                        <exit code="1" /> <!-- Returns 1 even when uninstall succeeds -->
                </command>
        </commands>
</package>

Content of greenshot.inf-File.

[Setup]
Lang=de-DE
Dir=C:\Program Files (x86)\Greenshot
Group=Greenshot
NoIcons=0
SetupType=custom
Components=plugins,plugins\titlefix
Tasks=startup

content of Greenshot-defaults.ini

; Greenshot core configuration
[Core]
; The language in IETF format (e.g. en-EN)
Language=de-DE
; Hotkey for starting the region capture
RegionHotkey=Ctrl + PrintScreen
; Hotkey for starting the window capture
WindowHotkey=PrintScreen
; Hotkey for starting the fullscreen capture
FullscreenHotkey=Alt + PrintScreen
; Hotkey for starting the last region capture
LastregionHotkey=Shift + PrintScreen
; Hotkey for starting the IE capture
IEHotkey=Ctrl + Shift + PrintScreen
; Is this the first time launch?
IsFirstLaunch=False
; Which destinations? Options are: Editor, FileDefault, FileWithDialog, Clipboard, Printer, EMail
Destinations=Clipboard,Editor
; Specify which formats we copy on the clipboard? Options are: PNG,HTML and DIB
ClipboardFormats=PNG,HTML,DIB
; Should the mouse be captured?
CaptureMousepointer=False
; Use interactive window selection to capture? (false=Capture active window)
CaptureWindowsInteractive=False
; Capture delay in millseconds.
CaptureDelay=100
; The capture mode used to capture a Window.
WindowCaptureMode=Auto
; The background color for a DWM window capture.
DWMBackgroundColor=White
; Play a camera sound after taking a capture.
PlayCameraSound=True
; Output file path.
;OutputFilePath=C:\Users\kbau\Desktop
; Filename pattern for screenshot.
OutputFileFilenamePattern=${capturetime}_${title}
; Default file type for writing screenshots. (bmp, gif, jpg, png, tiff)
OutputFileFormat=png
; If set to true, than the colors of the output file are reduced to 256 (8-bit) colors
OutputFileReduceColors=False
; Default type for emails. (txt, html)
OutputEMailFormat=MAPI
; How to export to outlook (AlwaysNew= always open a new one, TryOpenElseNew=look for open email else create a new)
OutputOutlookMethod=AlwaysNew
; When saving a screenshot, copy the path to the clipboard?
OutputFileCopyPathToClipboard=False
; SaveAs Full path?
;OutputFileAsFullpath=C:\Users\kbau\Desktop\dummy.png
; JPEG file save quality in %.
OutputFileJpegQuality=80
; Ask for the JPEQ quality before saving?
OutputFilePromptJpegQuality=False
; The number for the ${NUM} in the filename pattern, is increased automatically after each save.
OutputFileIncrementingNumber=1
; Ask for print options when printing?
OutputPrintPromptOptions=False
; Allow rotating the picture for fitting on paper?
OutputPrintAllowRotate=False
; Allow growing the picture for fitting on paper?
OutputPrintAllowEnlarge=False
; Allow shrinking the picture for fitting on paper?
OutputPrintAllowShrink=True
; Center image when printing?
OutputPrintCenter=True
; Print image inverted (use e.g. for console captures)
OutputPrintInverted=False
; Print timestamp on print?
OutputPrintTimestamp=True
; Use your global proxy?
UseProxy=True
; Enable/disable IE capture
IECapture=True
; Sets how to compare the colors for the autocrop detection, the higher the more is 'selected'. Possible values are from 0 to 255, where everything above ~150 doesn't make much sense!
AutoCropDifference=10
; Comma separated list of Plugins which are allowed. If something in the list, than every plugin not in the list will not be loaded!
IncludePlugins=
; Comma separated list of Plugins which are NOT allowed.
ExcludePlugins=
; How many days between every update check? (0=no checks)
UpdateCheckInterval=0
; Last update check
LastUpdateCheck=04/16/2012 11:17:15
; Enable/disable thumbnail previews
ThumnailPreview=True
; Greenshot TitleFix Plugin configuration
[TitleFix]
; The fixes that are active.
ActiveFixes=Firefox,IE,Chrome,Opera
; The regular expressions to match the title with.
Matcher.Firefox= - Mozilla Firefox.*
Matcher.IE= - (Microsoft|Windows) Internet Explorer.*
Matcher.Chrome= - Google Chrome.*
Matcher.Opera= - Opera.*
; The replacements for the matchers.
Replacer.Firefox=
Replacer.IE=
Replacer.Chrome=
Replacer.Opera=
; Greenshot editor configuration
[Editor]
; Last used colors
RecentColors=
; Field values, make sure the last used settings are re-used
LastFieldValue.CropContainer.FLAGS=Greenshot.Drawing.Fields.FieldType+Flag,Greenshot:CONFIRMABLE
; Match the editor window size to the capture
MatchSizeToCapture=True
; Placement flags
WindowPlacementFlags=0
; Show command
WindowShowCommand=Normal
; Position of minimized window
WindowMinPosition=-1, -1
; Position of maximized window
WindowMaxPosition=-1, -1
; Position of normal window
WindowNormalPosition=658, 31, 894, 779
; Suppressed the 'do you want to save' dialog when closing the editor.
SuppressSaveDialogAtClose=False

--Konus 15:31, 1 November 2012 (CET)

Important notice for version before and equal to 0.8.0.0627[edit]

If you want to install it completely silent, i want to point to several new installation parameters:

Perhaps you've had problems with automatically ajust the language settings through the silent installation process. In order to get rid of this, please download the actual Beta of GreenShot here: [1]

The silent installation switches and parameters, which are described in this post [2] , can not be used with 0.8.0.0627 In future releases the config.dat will be replaced by an ini-file for better configuration. This ini-file is also used by the new betas.

Hope this information can save you a lot of time.

Example installation with new Greenshot beta[edit]

"%~dp0Greenshot-INSTALLER-UNSTABLE-0.8.1.1486.exe" /LOADINF="%~dp0Greenshot-INSTALLER-UNSTABLE-0.8.1.1486.inf" /VERYSILENT /NORESTART --configure Ui_Language=de Ui_Effects_Flashlight=false Ui_Effects_CameraSound=false Output_File_Path="%USERPROFILE%\Desktop" Output_File_Format=Png Output_File_FilenamePattern="%title%-%NUM%"

You can perhaps add the --norun parameter at the end, so that greenshot don't start at the end of the installation.

Content of MY ini-File. (If you leave the "Dir=" parameter blank, the installaer choose automatically the right installation folder on x86 Systems (language based: "C:\Programme" or "C:\Program Files") or x64 ( C:\Program Files(x86) ) Systems.

[Setup]
Lang=de
Dir=
Group=Greenshot
NoIcons=0
Tasks=

Note: I was not successful in the subscribed way. First of all, I think it has the be Lang=de-DE. In addition to that, in my tests, all settings of --configure were ignored and I did not found a list of all possible settings. Thats why I created Greenshot-defaults.ini and placed it in %appdata% of the user, see Discussion .--Konus 14:05, 17 April 2012 (CEST)

Installation[edit]

Note that the installer from the website uses a dash in the version number (0.8.0-0627) and the file version uses a dot (0.8.0.0627) so you should rename the installer appropriately for consistency.

Also note that the uninstaller does not remove unins000.exe or the Greenshot folder, but this doesn't seem to cause any problems when reinstalling.

Greenshot requires .NET Framework 2.0. If it isn't installed, the installer will pop up a dialog asking if you want to install it. This will hang WPKG, so make sure .NET is installed first.

<package
  id="greenshot"
  name="Greenshot"
  revision="%version%"
  priority="0"
  reboot="false">

  <variable name="version" value="0.8.0.0627" />

  <check
    type="file"
    condition="versionequalto"
    path="%PROGRAMFILES%\Greenshot\Greenshot.exe"
    value="%version%" />
 
  <install cmd='"%SOFTWARE%\greenshot\Greenshot-INSTALLER-%version%.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' />

  <upgrade cmd='"%SOFTWARE%\greenshot\Greenshot-INSTALLER-%version%.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' />  

  <remove cmd='"%PROGRAMFILES%\Greenshot\unins000.exe" /SILENT'>
    <exit code="1" /> <!-- Returns 1 even when uninstall succeeds -->
  </remove>
</package>