This shows you the differences between two versions of the page.
userspace:active_setup_example [2014/08/06 09:24] holgerv created |
userspace:active_setup_example [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Active Setup (Example) ====== | ||
- | The following script registers a new //Active Setup// script that runs " | ||
- | |||
- | Tested with opsi 4.0.4\\ | ||
- | Tested with opsi-winst 4.11.4.3\\ | ||
- | By //holgerv// 2014-08-06 | ||
- | |||
- | //Active Setup// is a mechanism in Microsoft Windows to enforce a script (or multiple scripts) to be executed for each single user who logs on into Windows exactly once. It works for local profiles and for roaming profiles as well. | ||
- | |||
- | It is convenient for changing user profiles. | ||
- | |||
- | //Active Setup// entrys have a version number, so you can enforce that the actual version of your //Active Setup// script is executed for each user. | ||
- | |||
- | Limitation: //Active Setup// doesn' | ||
- | |||
- | Weblinks: | ||
- | * http:// | ||
- | * http:// | ||
- | |||
- | |||
- | **Tree:** | ||
- | < | ||
- | CLIENT_DATA | ||
- | ├ delsub.ins | ||
- | ├ setup.ins | ||
- | ├ uninstall.ins | ||
- | └ user.reg | ||
- | </ | ||
- | |||
- | |||
- | === setup.ins === | ||
- | <code winst> | ||
- | [Actions] | ||
- | SetLogLevel = 6 | ||
- | |||
- | DefVar $ProductId$ | ||
- | DefVar $ProgramPath$ | ||
- | DefVar $RegFileName$ | ||
- | DefVar $ScriptName$ | ||
- | |||
- | Set $ProductId$ = " | ||
- | Set $ProgramPath$ = " | ||
- | Set $RegFileName$ = " | ||
- | Set $ScriptName$ = " | ||
- | |||
- | Message " | ||
- | Sub " | ||
- | |||
- | Message "Copy .reg file to program directory ..." | ||
- | Files_Copy_Reg_File /SysNative | ||
- | |||
- | Message " | ||
- | DosInAnIcon_Create_Script /SysNative | ||
- | |||
- | Message " | ||
- | Registry_Enable_ActiveSetup_Script /SysNative | ||
- | |||
- | |||
- | [Files_Copy_Reg_File] | ||
- | copy " | ||
- | |||
- | [DosInAnIcon_Create_Script] | ||
- | echo reg.exe import " | ||
- | |||
- | [Registry_Enable_ActiveSetup_Script] | ||
- | openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\$ProductId$] | ||
- | set "" | ||
- | set " | ||
- | set " | ||
- | </ | ||
- | |||
- | ===uninstall.ins=== | ||
- | <code winst> | ||
- | [Actions] | ||
- | SetLogLevel = 6 | ||
- | |||
- | DefVar $ProductId$ | ||
- | DefVar $ProgramPath$ | ||
- | DefVar $RegFileName$ | ||
- | DefVar $ScriptName$ | ||
- | |||
- | Set $ProductId$ = " | ||
- | Set $ProgramPath$ = " | ||
- | Set $RegFileName$ = " | ||
- | Set $ScriptName$ = " | ||
- | |||
- | Message " | ||
- | Sub " | ||
- | </ | ||
- | |||
- | ===delsub.ins=== | ||
- | <code winst> | ||
- | Message " | ||
- | ; There' | ||
- | Registry_Disable_ActiveSetup_Script /SysNative | ||
- | |||
- | Message " | ||
- | If (FileExistsSysNative($ProgramPath$ + " | ||
- | Files_Delete_ActiveSetup_Script /SysNative | ||
- | endif | ||
- | |||
- | Message " | ||
- | If (FileExistsSysNative($ProgramPath$ + " | ||
- | Files_Delete_Reg_File /SysNative | ||
- | endif | ||
- | |||
- | |||
- | [Registry_Disable_ActiveSetup_Script] | ||
- | DeleteKey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\$ProductId$] | ||
- | |||
- | [Files_Delete_ActiveSetup_Script] | ||
- | Delete " | ||
- | |||
- | [Files_Delete_Reg_File] | ||
- | Delete " | ||
- | |||
- | You will also need a user.reg which contains the changes in HKCU that you want to import for each user. |