|
|
|
|
@@ -25,8 +25,16 @@ DefVar $OLD_VERSION$
|
|
|
|
|
DefVar $OLD_CREATOR_TAG$
|
|
|
|
|
DefVar $OLD_RELEASE$
|
|
|
|
|
|
|
|
|
|
DefVar $openvpn_userpasswd$
|
|
|
|
|
DefVar $UserExists$
|
|
|
|
|
|
|
|
|
|
DefStringlist $ResultList$
|
|
|
|
|
DefStringlist $ResultList2$
|
|
|
|
|
|
|
|
|
|
Set $INST_SystemType$ = GetSystemType
|
|
|
|
|
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
|
|
|
|
|
Set $openvpn_userpasswd$ = RandomStr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set $LogDir$ = "%SystemDrive%\tmp"
|
|
|
|
|
|
|
|
|
|
@@ -71,6 +79,29 @@ else
|
|
|
|
|
Winbatch_install_cert
|
|
|
|
|
Sub_check_exitcode
|
|
|
|
|
|
|
|
|
|
comment "get the name of the admin group"
|
|
|
|
|
comment "using psgetsid from sysinernals pstools"
|
|
|
|
|
set $ResultList$ = getOutStreamFromSection("DosInAnIcon_get_admin_group")
|
|
|
|
|
|
|
|
|
|
set $Group$ = takeString(6,$ResultList$)
|
|
|
|
|
set $Group$ = takeString(1,splitstring($Group$,"\"))
|
|
|
|
|
|
|
|
|
|
comment "Check if user exists."
|
|
|
|
|
comment "If user exists, the password will be altered. Otherwise, the user will be created."
|
|
|
|
|
set $ResultList2$ = getOutStreamFromSection("DosInAnIcon_checkuser")
|
|
|
|
|
set $UserExists$ = takeString(0,$ResultList2$)
|
|
|
|
|
|
|
|
|
|
setLogLevel=0
|
|
|
|
|
|
|
|
|
|
comment "create our local user"
|
|
|
|
|
if $UserExists$ = "no"
|
|
|
|
|
DosInAnIcon_makeadmin
|
|
|
|
|
else
|
|
|
|
|
DosInAnIcon_alter_pw
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
setLogLevel=3
|
|
|
|
|
|
|
|
|
|
comment "installing"
|
|
|
|
|
|
|
|
|
|
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
|
|
|
|
|
@@ -84,7 +115,7 @@ else
|
|
|
|
|
comment "Patch Registry"
|
|
|
|
|
Registry_install /32Bit
|
|
|
|
|
comment "Create shortcuts"
|
|
|
|
|
LinkFolder_install
|
|
|
|
|
LinkFolder_install_32
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
|
|
|
|
|
@@ -98,16 +129,32 @@ else
|
|
|
|
|
comment "Patch Registry"
|
|
|
|
|
Registry_install /64Bit
|
|
|
|
|
comment "Create shortcuts"
|
|
|
|
|
LinkFolder_install
|
|
|
|
|
LinkFolder_install_64
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
[DosInAnIcon_get_admin_group]
|
|
|
|
|
@echo off
|
|
|
|
|
"%ScriptPath%\ALL\PsGetsid.exe" /accepteula S-1-5-32-544
|
|
|
|
|
|
|
|
|
|
[DosInAnIcon_checkuser]
|
|
|
|
|
@echo off
|
|
|
|
|
net user openvpn >nul 2>&1 && echo yes || echo no
|
|
|
|
|
|
|
|
|
|
[DosInAnIcon_makeadmin]
|
|
|
|
|
NET USER openvpn $openvpn_userpasswd$ /ADD /comment:"Local User created by OpenVPN opsi-package" /fullname:"Local User by Opsi OpenVPN" /passwordchg:no /passwordreq:yes /expires:never /active:yes
|
|
|
|
|
NET LOCALGROUP $Group$ /ADD openvpn
|
|
|
|
|
|
|
|
|
|
[DosInAnIcon_alter_pw]
|
|
|
|
|
NET USER openvpn $openvpn_userpasswd$
|
|
|
|
|
|
|
|
|
|
[Winbatch_install_cert]
|
|
|
|
|
certutil -addstore "TrustedPublisher" "%ScriptPath%\OpenVPN Certificate.cer"
|
|
|
|
|
certutil -addstore "TrustedPublisher" "%ScriptPath%\OpenVPN-Certificate.cer"
|
|
|
|
|
|
|
|
|
|
[Winbatch_install_32]
|
|
|
|
|
"$Install32Exe$" /S
|
|
|
|
|
"%ScriptPath%\ALL\CPAU.exe" -u openvpn -p $openvpn_userpasswd$ -ex "$InstallDir32$\bin\openvpn-gui.exe" -enc -file "$InstallDir32$\openvpn.job" -crc "$InstallDir32$\bin\openvpn-gui.exe"
|
|
|
|
|
|
|
|
|
|
[Files_install_32]
|
|
|
|
|
; copy the ini file to the InstallDir
|
|
|
|
|
@@ -115,10 +162,11 @@ copy "$IniCfgFile$" "$InstallDir32$"
|
|
|
|
|
|
|
|
|
|
; Example of recursively copying some files into the installation directory:
|
|
|
|
|
;
|
|
|
|
|
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
|
|
|
|
|
copy -s "%ScriptPath%\ALL\CPAU.exe" "$InstallDir32$"
|
|
|
|
|
|
|
|
|
|
[Winbatch_install_64]
|
|
|
|
|
"$Install64Exe$" /S
|
|
|
|
|
"%ScriptPath%\ALL\CPAU.exe" -u openvpn -p $openvpn_userpasswd$ -ex "$InstallDir64$\bin\openvpn-gui.exe" -enc -file "$InstallDir64$\openvpn.job" -crc "$InstallDir64$\bin\openvpn-gui.exe"
|
|
|
|
|
|
|
|
|
|
[Files_install_64]
|
|
|
|
|
; copy the ini file to the InstallDir
|
|
|
|
|
@@ -126,7 +174,7 @@ copy "$IniCfgFile$" "$InstallDir64$"
|
|
|
|
|
|
|
|
|
|
; Example of recursively copying some files into the installation directory:
|
|
|
|
|
;
|
|
|
|
|
; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
|
|
|
|
|
copy -s "%ScriptPath%\ALL\CPAU.exe" "$InstallDir64$"
|
|
|
|
|
|
|
|
|
|
[Registry_install]
|
|
|
|
|
; Example of setting some values of an registry key:
|
|
|
|
|
@@ -136,39 +184,55 @@ copy "$IniCfgFile$" "$InstallDir64$"
|
|
|
|
|
; set "name2" = REG_DWORD:0001
|
|
|
|
|
; set "name3" = REG_BINARY:00 af 99 cd
|
|
|
|
|
|
|
|
|
|
[LinkFolder_install]
|
|
|
|
|
; Example of deleting a folder from AllUsers startmenu:
|
|
|
|
|
;
|
|
|
|
|
; set_basefolder common_programs
|
|
|
|
|
; delete_subfolder $ProductId$
|
|
|
|
|
;
|
|
|
|
|
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
|
|
|
|
|
;
|
|
|
|
|
; set_basefolder common_programs
|
|
|
|
|
; set_subfolder $ProductId$
|
|
|
|
|
;
|
|
|
|
|
; set_link
|
|
|
|
|
; name: $ProductId$
|
|
|
|
|
; target: <path to the program>
|
|
|
|
|
; parameters:
|
|
|
|
|
; working_dir: $InstallDir$
|
|
|
|
|
; icon_file:
|
|
|
|
|
; icon_index:
|
|
|
|
|
; end_link
|
|
|
|
|
;
|
|
|
|
|
; Example of creating an shortcut to the installed exe on AllUsers desktop:
|
|
|
|
|
;
|
|
|
|
|
; set_basefolder common_desktopdirectory
|
|
|
|
|
; set_subfolder ""
|
|
|
|
|
;
|
|
|
|
|
; set_link
|
|
|
|
|
; name: $ProductId$
|
|
|
|
|
; target: <path to the program>
|
|
|
|
|
; parameters: <some_param>
|
|
|
|
|
; working_dir: $InstallDir$
|
|
|
|
|
; icon_file: <path to icon file>
|
|
|
|
|
; icon_index: 2
|
|
|
|
|
; end_link
|
|
|
|
|
[LinkFolder_install_32]
|
|
|
|
|
set_basefolder common_programs
|
|
|
|
|
set_subfolder OpenVPN
|
|
|
|
|
|
|
|
|
|
set_link
|
|
|
|
|
name: OpenVPN GUI
|
|
|
|
|
target: $InstallDir32$/CPAU.exe
|
|
|
|
|
parameters: -dec -file $InstallDir32$\openvpn.job
|
|
|
|
|
working_dir: $InstallDir32$
|
|
|
|
|
icon_file: $InstallDir32$\icon.ico
|
|
|
|
|
icon_index:
|
|
|
|
|
end_link
|
|
|
|
|
|
|
|
|
|
set_basefolder common_desktopdirectory
|
|
|
|
|
set_subfolder ""
|
|
|
|
|
|
|
|
|
|
set_link
|
|
|
|
|
name: OpenVPN GUI
|
|
|
|
|
target: $InstallDir32$/CPAU.exe
|
|
|
|
|
parameters: -dec -file $InstallDir32$\openvpn.job
|
|
|
|
|
working_dir: $InstallDir32$
|
|
|
|
|
icon_file: $InstallDir32$\icon.ico
|
|
|
|
|
icon_index:
|
|
|
|
|
end_link
|
|
|
|
|
|
|
|
|
|
[LinkFolder_install_64]
|
|
|
|
|
set_basefolder common_programs
|
|
|
|
|
set_subfolder OpenVPN
|
|
|
|
|
|
|
|
|
|
set_link
|
|
|
|
|
name: OpenVPN GUI
|
|
|
|
|
target: $InstallDir64$/CPAU.exe
|
|
|
|
|
parameters: -dec -file $InstallDir64$\openvpn.job
|
|
|
|
|
working_dir: $InstallDir64$
|
|
|
|
|
icon_file: $InstallDir64$\icon.ico
|
|
|
|
|
icon_index:
|
|
|
|
|
end_link
|
|
|
|
|
|
|
|
|
|
set_basefolder common_desktopdirectory
|
|
|
|
|
set_subfolder ""
|
|
|
|
|
|
|
|
|
|
set_link
|
|
|
|
|
name: OpenVPN GUI
|
|
|
|
|
target: $InstallDir64$/CPAU.exe
|
|
|
|
|
parameters: -dec -file $InstallDir64$\openvpn.job
|
|
|
|
|
working_dir: $InstallDir64$
|
|
|
|
|
icon_file: $InstallDir64$\icon.ico
|
|
|
|
|
icon_index:
|
|
|
|
|
end_link
|
|
|
|
|
|
|
|
|
|
[Sub_check_exitcode]
|
|
|
|
|
comment "Test for installation success via exit code"
|
|
|
|
|
|