remoove the dumb workaround and remove the menu entries and desktop icon openvpn manager is working better

This commit is contained in:
Mario Fetka 2014-03-08 21:37:57 +01:00
parent c6431e6628
commit f13d8d3d40
7 changed files with 10 additions and 158 deletions

View File

@ -71,25 +71,6 @@ endif
comment "Delete program shortcuts" comment "Delete program shortcuts"
LinkFolder_uninstall LinkFolder_uninstall
comment "Check if user exists."
set $ResultList2$ = getOutStreamFromSection("DosInAnIcon_checkuser")
set $UserExists$ = takeString(0,$ResultList2$)
set $UserExists$ = takeString(0,splitstring($UserExists$," "))
if $UserExists$ = "yes"
DosInAnIcon_deleteuser
;else
; LogError "User 'openvpn' does not exist!"
; isFatalError
endif
[DosInAnIcon_checkuser]
@echo off
net user openvpn >nul 2>&1 && echo yes || echo no
[DosInAnIcon_deleteuser]
NET USER openvpn /DELETE
[Winbatch_uninstall_old_32] [Winbatch_uninstall_old_32]
"$UninstallProgramOld32$" /S "$UninstallProgramOld32$" /S

View File

@ -25,18 +25,8 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$ DefVar $OLD_RELEASE$
DefVar $Group$
DefVar $NetGroup$
DefVar $openvpn_userpasswd$
DefVar $UserExists$
DefStringlist $ResultList$
DefStringlist $ResultList2$
Set $INST_SystemType$ = GetSystemType Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific") set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $openvpn_userpasswd$ = RandomStr
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
@ -81,35 +71,6 @@ else
Winbatch_install_cert Winbatch_install_cert
Sub_check_exitcode 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$,"\"))
set $ResultList$ = getOutStreamFromSection("DosInAnIcon_get_netadmin_group")
set $NetGroup$ = takeString(6,$ResultList$)
set $NetGroup$ = takeString(1,splitstring($NetGroup$,"\"))
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" comment "installing"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
@ -123,7 +84,7 @@ else
comment "Patch Registry" comment "Patch Registry"
Registry_install /32Bit Registry_install /32Bit
comment "Create shortcuts" comment "Create shortcuts"
LinkFolder_install_32 LinkFolder_install
endif endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
@ -137,37 +98,16 @@ else
comment "Patch Registry" comment "Patch Registry"
Registry_install /64Bit Registry_install /64Bit
comment "Create shortcuts" comment "Create shortcuts"
LinkFolder_install_64 LinkFolder_install
endif endif
endif endif
[DosInAnIcon_get_admin_group]
@echo off
"%ScriptPath%\ALL\PsGetsid.exe" /accepteula S-1-5-32-544
[DosInAnIcon_get_netadmin_group]
@echo off
"%ScriptPath%\ALL\PsGetsid.exe" /accepteula S-1-5-32-556
[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
NET LOCALGROUP $NetGroup$ /ADD openvpn
[DosInAnIcon_alter_pw]
NET USER openvpn $openvpn_userpasswd$
[Winbatch_install_cert] [Winbatch_install_cert]
certutil -addstore "TrustedPublisher" "%ScriptPath%\OpenVPN-Certificate.cer" certutil -addstore "TrustedPublisher" "%ScriptPath%\OpenVPN Certificate.cer"
[Winbatch_install_32] [Winbatch_install_32]
"$Install32Exe$" /S "$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] [Files_install_32]
; copy the ini file to the InstallDir ; copy the ini file to the InstallDir
@ -175,11 +115,10 @@ copy "$IniCfgFile$" "$InstallDir32$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
copy -s "%ScriptPath%\ALL\CPAU.exe" "$InstallDir32$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
[Winbatch_install_64] [Winbatch_install_64]
"$Install64Exe$" /S "$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] [Files_install_64]
; copy the ini file to the InstallDir ; copy the ini file to the InstallDir
@ -187,7 +126,7 @@ copy "$IniCfgFile$" "$InstallDir64$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
copy -s "%ScriptPath%\ALL\CPAU.exe" "$InstallDir64$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
[Registry_install] [Registry_install]
; Example of setting some values of an registry key: ; Example of setting some values of an registry key:
@ -197,55 +136,14 @@ copy -s "%ScriptPath%\ALL\CPAU.exe" "$InstallDir64$"
; set "name2" = REG_DWORD:0001 ; set "name2" = REG_DWORD:0001
; set "name3" = REG_BINARY:00 af 99 cd ; set "name3" = REG_BINARY:00 af 99 cd
[LinkFolder_install_32] [LinkFolder_install]
set_basefolder common_programs set_basefolder common_programs
set_subfolder OpenVPN delete_subfolder OpenVPN
set_link
name: OpenVPN GUI
target: $InstallDir32$/CPAU.exe
parameters: -dec -file "$InstallDir32$\openvpn.job" -lwp
working_dir: $InstallDir32$
icon_file: $InstallDir32$\icon.ico
icon_index:
end_link
set_basefolder common_desktopdirectory set_basefolder common_desktopdirectory
set_subfolder "" set_subfolder ""
delete_element "OpenVPN GUI"
set_link
name: OpenVPN GUI
target: $InstallDir32$/CPAU.exe
parameters: -dec -file "$InstallDir32$\openvpn.job" - lwp
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" -lwp
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" -lwp
working_dir: $InstallDir64$
icon_file: $InstallDir64$\icon.ico
icon_index:
end_link
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"

View File

@ -6,9 +6,11 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProg32$
DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$ DefVar $UninstallProgramOld32$
DefVar $IniFile32$ DefVar $IniFile32$
DefVar $UninstallProg64$
DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$ DefVar $UninstallProgramOld64$
DefVar $IniFile64$ DefVar $IniFile64$
@ -24,10 +26,6 @@ DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$ DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$ DefVar $OLD_RELEASE$
DefVar $Group$
DefVar $UserExists$
DefStringlist $ResultList2$
Set $INST_SystemType$ = GetSystemType Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific") set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
@ -62,9 +60,3 @@ if FileExists("%ScriptPath%\delsub3264.ins")
Sub "%ScriptPath%\delsub3264.ins" Sub "%ScriptPath%\delsub3264.ins"
endif endif
[DosInAnIcon_checkuser]
@echo off
net user openvpn >nul 2>&1 && echo yes || echo no
[DosInAnIcon_deleteuser]
NET USER openvpn /DELETE

View File

@ -1 +0,0 @@
6276607c6c3c59c2e00de8196c55192d8a50c61b /home/mario/.opsi-dist-cache/openvpn.openvpn-2.3.2/ALL/CPAU-2.3.2.zip

View File

@ -1 +0,0 @@
c23826f8c056c1641eac698f5937615f8d6e1f47 /home/mario/.opsi-dist-cache/openvpn.openvpn-2.3.2/RUN/PSTools-2.3.2.zip

View File

@ -32,16 +32,6 @@ DL_SOURCE[3]="http://nativeex.boot-land.net/Programs/DriverSigning/DriverSigning
DL_ARCH[3]="X86" DL_ARCH[3]="X86"
DL_WINST_NAME[3]=Driversigning32Exe DL_WINST_NAME[3]=Driversigning32Exe
DL_FILE[4]="CPAU-${VERSION}.zip"
DL_SOURCE[4]="http://www.joeware.net/downloads/dl.php"
DL_ARCH[4]="ALL"
DL_EXTRACT_FORMAT[4]="unzip"
DL_FILE[5]="PSTools-${VERSION}.zip"
DL_SOURCE[5]="http://download.sysinternals.com/files/PSTools.zip"
DL_ARCH[5]="ALL"
DL_EXTRACT_FORMAT[5]="unzip"
# File array index for the image showing while installing the program # File array index for the image showing while installing the program
ICON_DL_INDEX=0 ICON_DL_INDEX=0

View File

@ -23,10 +23,3 @@ function cleanup() {
echo "Cleanup" echo "Cleanup"
builder_cleanup builder_cleanup
} }
function create() {
echo "Create"
builder_create
find $INST_DIR/CLIENT_DATA/ALL/ -type f ! -name 'PsGet*' ! -name 'CPAU*' -delete
}