openvpn.config/CLIENT_DATA/setup32.ins

156 lines
5.9 KiB
TeX

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
DefVar $wget$
DefVar $wget_uninst$
DefVar $Ovpn-Config-Dir$
DefVar $Konfig-URL$
DefVar $defPW$
DefVar $pw$
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
Set $wget$ = "%SystemDrive%\Programme\GnuWin32\bin\wget.exe"
;Set $wget_uninst$ = GetRegistrystringvalue("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wget-1.11.4-1_is1] UninstallString")
;Set $wget_uninst$ = unquote($wget_uninst$,$wget_uninst$)
Set $Ovpn-Config-Dir$ = "%SystemDrive%\Programme\OpenVPN\config"
Set $Konfig-URL$ = GetIni ("%ScriptPath%\url.ini" [Webserver] URL)
Set $defPW$ = GetIni ("%ScriptPath%\url.ini" [Webserver] defPW)
Set $pw$ = GetProductProperty ("apache-pw","values")
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - 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$ = "openvpn-config"
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\<path to the product>"
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$
if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins"
endif
Message "Installing " + $ProductId$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
if $pw$ = ""
Set $pw$ = $defPW$
endif
comment "Start setup program"
Winbatch_install
Sub_check_exitcode
comment "Patch Registry"
Registry_install /32Bit
comment "Default-User in Registry"
Registry_AllUsers /AllNTUserdats
comment "Reboot"
ExitWindows /Reboot
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
[Winbatch_install]
; Choose one of the following examples as basis for your installation
; You can use $LicenseKey$ var to pass a license key to the installer
;
; === Nullsoft Scriptable Install System ================================================================
"$Wget32Exe$" /Silent
;Set $wget_uninst$ = GetRegistrystringvalue("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wget-1.11.4-1_is1] UninstallString")
;Set $wget_uninst$ = unquote($wget_uninst$,$wget_uninst$)
"%ScriptPath%\reghack.vbs"
"%ScriptPath%\reghack2.vbs"
"%ScriptPath%\reg_ndiwswan_bind.vbs"
"%Scriptpath%\enable_rdp.vbs"
$wget$ -O $Ovpn-Config-Dir$\ca.crt --http-user=%PCName% --password=$pw$ $Konfig-URL$/%PCName%/ca.crt
$wget$ -O $Ovpn-Config-Dir$\client.crt --http-user=%PCName% --password=$pw$ $Konfig-URL$/%PCName%/client.crt
$wget$ -O $Ovpn-Config-Dir$\client.key --http-user=%PCName% --password=$pw$ $Konfig-URL$/%PCName%/client.key
$wget$ -O $Ovpn-Config-Dir$\client.ovpn --http-user=%PCName% --password=$pw$ $Konfig-URL$/%PCName%/client.ovpn
$wget$ -O $Ovpn-Config-Dir$\ta.key --http-user=%PCName% --password=$pw$ $Konfig-URL$/%PCName%/ta.key
cacls $Ovpn-Config-Dir$ /E /R Benutzer
cacls $Ovpn-Config-Dir$ /E /R Hauptbenutzer
sc config OpenVPNService start= auto
netsh firewall set opmode mode=disable interface="LAN-Verbindung OpenVPN"
netsh firewall set service type=remotedesktop mode=enable scope=all
;$wget_uninst$ /silent
[Registry_install]
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
set "fDenyTSConnections" = REG_DWORD:0000
openkey [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters]
set "MaxPacketSize"=reg_dword:01
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
set "GpNetworkStartTimeoutPolicyValue"=reg_dword:60
set "GroupPolicyMinTransferRate"=reg_dword:00
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System]
set "GpNetworkStartTimeoutPolicyValue"=reg_dword:60
set "GroupPolicyMinTransferRate"=reg_dword:00
[Registry_AllUsers]
openkey [SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
set "GpNetworkStartTimeoutPolicyValue"=reg_dword:60
set "GroupPolicyMinTransferRate"=reg_dword:00