Seite 1 von 1

Deploiement de Greenshot

Verfasst: 06 Aug 2019, 22:30
von guillaume
Bonjour,

Je cherche à déployer Greenshot proprement :
- en retirant l'ouverture de la page web à la fin de l'installation
- en mettant le logiciel en français
- en désactivant la popup de mise à jour

Je n'ai pas trouvé de solution pour effectuer cela de façon automatisée avec OPSI. Avez vous réussi à faire cela, si oui, avez vous quelques pistes à me donner ?

Merci

Re: Deploiement de Greenshot

Verfasst: 09 Aug 2019, 10:39
von SisterOfMercy
My installscript manually copies files.

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.11.5.14"

DefVar $LogDir$
DefVar $ProductId$ 
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $INST_MsVersion$

DefStringList $ProductInfo$
DefVar $DisplayVersion$
DefVar $DisplayName$
set $ProductInfo$ = getProductMap
set $DisplayVersion$ = getValue("productversion", $ProductInfo$)
set $DisplayName$ = getValue("name", $ProductInfo$)

set $INST_MsVersion$ = GetMsVersionInfo
Set $INST_SystemType$ = GetSystemType
Set $LogDir$ = "%SystemDrive%\tmp"

;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $ProductId$       = "greenshot"
Set $MinimumSpace$    = "500 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\Greenshot"

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
   LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
   isFatalError
   ; Stop process and set installation status to failed
endif
if CompareDotSeparatedNumbers($INST_MsVersion$, "<", "5.1")
   LogError "Windows XP or newer is required for " + $ProductId$ 
   isFatalError
endif
   
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$

if FileExists("%ScriptPath%\delsub3264.opsiscript")
   comment "Start uninstall sub section"
   Sub "%ScriptPath%\delsub3264.opsiscript"
endif
   
comment "installing"

if ($INST_SystemType$ = "x86 System")
   Message "Installing " + $ProductId$ + "..."
   comment "Copy files"
   Files_install_32 /32Bit
   comment "Patch ini-files"   
   Patches_greenshot-fixed.ini $InstallDir32$ + "\greenshot-fixed.ini"
   Patches_greenshot-defaults.ini $InstallDir32$ + "\greenshot-defaults.ini"   
   comment "Patch Registry"
   Registry_install /32Bit
   Registry_install_AllProfiles /AllNTUserDats
   comment "Create shortcuts"
   LinkFolder_install
endif

if ($INST_SystemType$ = "64 Bit System")
   Message "Installing " + $ProductId$ + "..."
   comment "Copy files"
   Files_install_32 /64Bit
   comment "Patch ini-files"   
   Patches_greenshot-fixed.ini $InstallDir32$ + "\greenshot-fixed.ini"
   Patches_greenshot-defaults.ini $InstallDir32$ + "\greenshot-defaults.ini"
   comment "Patch Registry"
   Registry_install /32Bit
   Registry_install_AllProfiles /AllNTUserDats
   comment "Create shortcuts"
   LinkFolder_install
endif

[Files_install_32]
copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"

[Patches_greenshot-fixed.ini]
set [Core] UpdateCheckInterval=0
set [Core] IsFirstLaunch=False

[Patches_greenshot-defaults.ini]
set [Core] Language=en-US
set [Core] PlayCameraSound=False
set [Core] OutputFileFormat=png
set [Core] OutputPrintFooter=False
set [Core] IECapture=False

[Registry_install]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$ProductId$]
set "Comments" = "Installed with OPSI"
set "DisplayIcon" = "$InstallDir32$\Greenshot.exe"
set "DisplayVersion" = "$DisplayVersion$"
set "NoModify" = REG_DWORD:00000001
set "NoRepair" = REG_DWORD:00000001
set "NoRemove" = REG_DWORD:00000001
set "Publisher" = "Greenshot Team"
set "DisplayName" = "$DisplayName$ $DisplayVersion$"
set "UninstallString" = "$InstallDir32$\Greenshot.exe"
set "InstallLocation" = "$InstallDir32$"

[Registry_install_AllProfiles]
; Remove stored start menu order
deletekey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu]

[LinkFolder_install]
set_basefolder common_programs
set_subfolder ""
set_link
    name: "Greenshot"
    target: "$InstallDir32$\Greenshot.exe"
    parameters:
    working_dir: "$InstallDir32$"
    icon_file: "$InstallDir32$\Greenshot.exe"
    icon_index: 0
end_link


contents of files directory:

Code: Alles auswählen

Languages\help-en-US.html
Languages\help-nl-NL.html
Languages\language-en-US.xml
Languages\language-nl-NL.xml
Greenshot.exe
Greenshot.exe.config
greenshot-defaults.ini
greenshot-fixed.ini
GreenshotPlugin.dll
LinqBridge.dll
log4net.dll
log4net.xml
readme.txt

Re: Deploiement de Greenshot

Verfasst: 09 Aug 2019, 17:12
von guillaume
Thank you SisterofMercy, i do not expect so much, that's really appreciated !!
I'll try it asap and change this post as resolved if everything's OK

Re: Deploiement de Greenshot

Verfasst: 21 Mai 2020, 17:53
von guillaume
Hello SisterofMercy

I'm back after months. I'm starting seriously apps and OS deployment now.
I have some trouble on Greenshot, i deploy it a little bit different form your script. The issue is that i try to remove some files and add others but nothing append. Here is a part of the script :

Code: Alles auswählen

[Files_install]
; Remove all original files
del -f "$InstallDir$\Languages\*.xml"
del -f "$InstallDir$\Languages\*.html"
; Add my languages files
copy "%ScriptPath%\files\*.xml" "$InstallDir$\Languages"
copy "%ScriptPath%\files\*.html" "$InstallDir$\Languages"

; Actually not working on it but coming after previous issue solved
[Patches_greenshot-fixed.ini]
;set [Core] UpdateCheckInterval=0
;set [Core] IsFirstLaunch=False

; Actually not working on it but coming after previous issue solved
[Patches_greenshot-defaults.ini]
;set [Core] Language=fr-QC
;set [Core] PlayCameraSound=False
;set [Core] OutputFileFormat=png
;set [Core] OutputPrintFooter=False
;set [Core] IECapture=False


Also logs didnt' show me anything : no error and also no try of coping files ...

Code: Alles auswählen

(155)     [5] [mai 21 15:47:14:258] [greenshot]   comment: Start setup program
(156)     [5] [mai 21 15:47:14:258] [greenshot]   Execution of: Winbatch_install
(157)     [5] [mai 21 15:47:14:258] [greenshot]   
(158)     [6] [mai 21 15:47:14:262] [greenshot]     Call ""p:\greenshot\Greenshot-INSTALLER-1.2.10.6-RELEASE.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART"
(159)     [6] [mai 21 15:47:14:262] [greenshot]        Waiting until the called process is finished
(160)     [6] [mai 21 15:47:14:262] [greenshot]     Start process as invoker: SYSTEM
(161)     [6] [mai 21 15:47:20:714] [greenshot]     ExitCode 0    Executed process ""p:\greenshot\Greenshot-INSTALLER-1.2.10.6-RELEASE.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART"
(162)     [6] [mai 21 15:47:20:718] [greenshot]   
(163)     [6] [mai 21 15:47:20:718] [greenshot]   ~~~~~~~ Start Sub ~~~~~~~  Sub_check_exitcode
(164)     [5] [mai 21 15:47:20:719] [greenshot]   comment: Test for installation success via exit code
(165)     [6] [mai 21 15:47:20:719] [greenshot]   Set  $ExitCode$ = getLastExitCode
(166)     [6] [mai 21 15:47:20:720] [greenshot]     The value of the variable "$ExitCode$" is now: "0"
(167)     [6] [mai 21 15:47:20:720] [greenshot]   If
(168)     [6] [mai 21 15:47:20:720] [greenshot]     ($ExitCode$ = "0")   <<< result true
(169)     [6] [mai 21 15:47:20:720] [greenshot]   Then
(170)     [5] [mai 21 15:47:20:720] [greenshot]     comment: Looks good: setup program gives exitcode zero
(171)     [6] [mai 21 15:47:20:720] [greenshot]   Else
(172)     [6] [mai 21 15:47:20:720] [greenshot]     If
(173)     [6] [mai 21 15:47:20:720] [greenshot]     Then
(174)     [6] [mai 21 15:47:20:720] [greenshot]     Else
(175)     [6] [mai 21 15:47:20:720] [greenshot]       If
(176)     [6] [mai 21 15:47:20:720] [greenshot]       Then
(177)     [6] [mai 21 15:47:20:720] [greenshot]       Else
(178)     [6] [mai 21 15:47:20:720] [greenshot]         If
(179)     [6] [mai 21 15:47:20:720] [greenshot]         Then
(180)     [6] [mai 21 15:47:20:720] [greenshot]         Else
(181)     [6] [mai 21 15:47:20:720] [greenshot]         EndIf
(182)     [6] [mai 21 15:47:20:720] [greenshot]       EndIf
(183)     [6] [mai 21 15:47:20:720] [greenshot]     EndIf
(184)     [6] [mai 21 15:47:20:720] [greenshot]   EndIf
(185)     [6] [mai 21 15:47:20:720] [greenshot]   
(186)     [6] [mai 21 15:47:20:720] [greenshot]   ~~~~~~~ End Sub   ~~~~~~~  Sub_check_exitcode
(187)     [6] [mai 21 15:47:20:720] [greenshot]   
(188)     [6] [mai 21 15:47:20:720] [greenshot] EndIf
(189)     [1] [mai 21 15:47:20:720] [greenshot] ___________________
(190)     [1] [mai 21 15:47:20:720] [greenshot] script finished: success
(191)     [1] [mai 21 15:47:20:720] [greenshot] 0 errors
(192)     [1] [mai 21 15:47:20:720] [greenshot] 0 warnings


Do you have any idea why i cannot copy files like you do so in your own script ?

Thanks for your help !