Seite 1 von 1

Windows 10 Desktop-Verknüpfung anlegen

Verfasst: 02 Jul 2019, 12:08
von stutti
Hallo zusammen,

ich versuche momentan über das Setup-Script eine Desktop-Verknüpfung für alle User auf Windows 10 zu erstellen.
Jedoch klappt das nicht so ganz, nicht mal im Log finde ich was dazu. Als würde Opsi den teil des Scriptes überspringen...

Eventuell kann mir jemand helfen.

Hier die Setup.ins ->

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$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$       = "avero_laufzeit"
Set $MinimumSpace$    = "10 MB"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFiles64Dir%\Avero"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
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
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
; Do not attempt uninstall
	if FileExists("%ScriptPath%\delsub64.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub64.ins"
	endif
 
	Message "Installing " + $ProductId$ + " ..."
 
	comment "Start setup program"
	Winbatch_install /64Bit
	Sub_check_exitcode

	comment "Test for installation success"
	; Test if software marked as installed in registry
	; if (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] DisplayName") = "")
	; 	logError "Fatal: After Installation 32 bit [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] not found"
	; 	isFatalError
	; else
	; 	comment "Successful Installation"
	; endif
 
endif
 
Registry loadUnicodeTextFile("%scriptpath%/files/avero-reg.reg") /regedit

[Winbatch_install]
"%ScriptPath%\files\Setup.exe" /s /f1"%ScriptPath%\files\Setup.iss"

[LinkFolder_install]
 set_basefolder common_desktopdirectory
 set_subfolder ""

 set_link
 	name: $ProductId$
 	target: "\\server\avero$\AVERO.EXE"
 	parameters: <some_param>
 	working_dir: "\\server\avero$"
 	icon_file:
 	icon_index:
 end_link

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
Hat mir jemand von euch ein Beispiel für eine Desktop-Verknüpfung?

PS: Die Windows 10 Rechner sind in einer Windows Domäne.

Beste Dank und Grüße

Re: Windows 10 Desktop-Verknüpfung anlegen

Verfasst: 02 Jul 2019, 12:13
von ThomasT
Ja, die sekundäre LinkFolder_install Sektion wird übersprungen, da in der primären Actions Sektion kein Verweis auf sie erfolgt.
https://download.uib.de/opsi4.1/documen ... n-tutorial

Re: Windows 10 Desktop-Verknüpfung anlegen

Verfasst: 02 Jul 2019, 12:40
von stutti
Vielen lieben Dank! Ich arbeite noch nicht sehr lange mit Opsi und das ist mir nicht aufgefallen...

Funktioniert nun ;)

Re: Windows 10 Desktop-Verknüpfung anlegen

Verfasst: 02 Jul 2019, 13:16
von ThomasT
Kein Problem, dafür ist das Forum da ;-)
In dem Sinne herzlich willkommen!