revised and updated
This commit is contained in:
parent
09377f3ab8
commit
6f8f604b2d
4
CLIENT_DATA/service_batch.bat
Normal file
4
CLIENT_DATA/service_batch.bat
Normal file
@ -0,0 +1,4 @@
|
||||
rundll32 user32.dll LockWorkStation %windir%
|
||||
ms-activation.vbs
|
||||
sc config opsiclientd start= auto
|
||||
net start opsiclientd
|
@ -6,6 +6,10 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.10.8.6"
|
||||
|
||||
|
||||
DefVar $Proxy_Port$
|
||||
DefVar $Flag$
|
||||
DefVar $WinstRegKey$
|
||||
DefVar $MsiId$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $LogDir$
|
||||
@ -18,6 +22,9 @@ DefVar $LicenseKey$
|
||||
DefVar $LicensePool$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
Set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
|
||||
Set $Flag$ = GetRegistryStringValue32("["+$WinstRegKey$+"] "+"RebootFlag")
|
||||
Set $Proxy_Port$ = "pubproxy:3128"
|
||||
|
||||
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
|
||||
; and adds the following variables:
|
||||
@ -27,7 +34,29 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
; auto generated winst-variables
|
||||
; $IconFile$: path to product picture
|
||||
;
|
||||
@@BUILDER_VARIABLES@@
|
||||
DefVar $VENDOR$
|
||||
Set $VENDOR$ = "microsoft.com"
|
||||
DefVar $PN$
|
||||
Set $PN$ = "windows.activation"
|
||||
DefVar $VERSION$
|
||||
Set $VERSION$ = "1"
|
||||
DefVar $RELEASE$
|
||||
Set $RELEASE$ = "5"
|
||||
DefVar $PRIORITY$
|
||||
Set $PRIORITY$ = "0"
|
||||
DefVar $ADVICE$
|
||||
Set $ADVICE$ = ""
|
||||
DefVar $TYPE$
|
||||
Set $TYPE$ = "public"
|
||||
DefVar $CREATOR_TAG$
|
||||
Set $CREATOR_TAG$ = "dt"
|
||||
DefVar $CREATOR_NAME$
|
||||
Set $CREATOR_NAME$ = "Dennis Trinks"
|
||||
DefVar $CREATOR_EMAIL$
|
||||
Set $CREATOR_EMAIL$ = "dennis.trinks@dtnet.de"
|
||||
DefVar $IconFile$
|
||||
Set $IconFile$ = "%ScriptPath%\windows.activation.png"
|
||||
|
||||
|
||||
; ----------------------------------------------------------------
|
||||
; - Please edit the following values -
|
||||
@ -63,19 +92,44 @@ else
|
||||
Sub_get_licensekey
|
||||
endif
|
||||
|
||||
|
||||
comment "Copy files"
|
||||
if $Flag$ = ""
|
||||
Set $Flag$ = "1"
|
||||
Registry_SaveRebootFlag
|
||||
DOSInAnIcon_AddActivationAdmin
|
||||
DOSInAnIcon_deactOpsiSrv
|
||||
; DOSInAnIcon_SetProxy
|
||||
Files_install_servicebatch
|
||||
Files_install
|
||||
Registry_SetAutoadmin
|
||||
Registry_SetRunOnce
|
||||
ExitWindows /ImmediateReboot
|
||||
Endif
|
||||
|
||||
comment "Start setup program"
|
||||
Winbatch_install
|
||||
Sub_check_exitcode
|
||||
if $Flag$ = "1"
|
||||
Set $Flag$ = "2"
|
||||
DOSInAnIcon_deactOpsiSrv
|
||||
Registry_SetRunOnce
|
||||
Registry_SaveRebootFlag
|
||||
ExitWindows /ImmediateReboot
|
||||
Endif
|
||||
|
||||
comment "Reboot"
|
||||
ExitWindows /Reboot
|
||||
if $Flag$ = "2"
|
||||
Set $Flag$ = "3"
|
||||
Registry_SaveRebootFlag
|
||||
Registry_DisableAutoadmin
|
||||
ExitWindows /ImmediateReboot
|
||||
Endif
|
||||
|
||||
|
||||
if $Flag$ = "3"
|
||||
Registry_DeleteRebootFlag
|
||||
DOSInAnIcon_DeleteActivationAdmin
|
||||
Endif
|
||||
endif
|
||||
|
||||
[Files_install_servicebatch]
|
||||
copy "%ScriptPath%\service_batch.bat" "C:\tmp"
|
||||
|
||||
[Files_install]
|
||||
copy "%ScriptPath%\ms-activation.vbs" %System%
|
||||
|
||||
@ -99,3 +153,41 @@ else
|
||||
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
|
||||
isFatalError
|
||||
endif
|
||||
|
||||
[Registry_SaveRebootFlag]
|
||||
openKey [$WinstRegKey$]
|
||||
set "RebootFlag" = "$Flag$"
|
||||
|
||||
[Registry_DeleteRebootFlag]
|
||||
openKey [$WinstRegKey$]
|
||||
DeleteVar "RebootFlag"
|
||||
|
||||
[Registry_SetAutoadmin]
|
||||
openkey [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
|
||||
set "DefaultUserName"="activationadmin"
|
||||
set "DefaultPassword"="4ct1vat!0n"
|
||||
set "DefaultDomainName"="%PCName%"
|
||||
set "AutoAdminLogon"="1"
|
||||
|
||||
[Registry_DisableAutoadmin]
|
||||
openkey [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
|
||||
set "DefaultUserName"=""
|
||||
set "DefaultPassword"=""
|
||||
set "AutoAdminLogon"="0"
|
||||
|
||||
[Registry_SetRunOnce]
|
||||
openkey [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
|
||||
set "OpsiService"="C:\tmp\service_batch.bat"
|
||||
|
||||
[DOSInAnIcon_AddActivationAdmin]
|
||||
net user activationadmin 4ct1vat!0n /add
|
||||
net localgroup Administratoren /add activationadmin
|
||||
|
||||
[DOSInAnIcon_DeleteActivationAdmin]
|
||||
net user activationadmin /delete
|
||||
|
||||
[DOSInAnIcon_SetProxy]
|
||||
proxycfg -p $Proxy_Port$
|
||||
|
||||
[DOSInAnIcon_deactOpsiSrv]
|
||||
sc config opsiclientd start= disabled
|
||||
|
Loading…
Reference in New Issue
Block a user