This shows you the differences between two versions of the page.
userspace:win-config-power [2014/01/24 09:20] Kevin W. Fix: add missing "/" |
userspace:win-config-power [2021/08/23 08:37] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Win-Config-Power ====== | ||
- | **Feel free to contact me :)** | ||
- | Tested with opsi 4.0.3.1\\ | ||
- | requiredWinstVersion >= 4.10.8.3\\ | ||
- | Tested with Windows 7/8 Enterprise x64/x32\\ | ||
- | **Not working for Windows XP**\\ | ||
- | By [[Kevin.Weis@faw.de|Kevin Weis]] 2014-01-22\\ | ||
- | |||
- | Download: [[https:// | ||
- | |||
- | < | ||
- | Tree: | ||
- | |-- delsub.ins | ||
- | |-- FAW gGmbH.pow | ||
- | |-- once.ins | ||
- | |-- pow_cnfg.png | ||
- | |-- pow_cnfg_full_size.png | ||
- | |-- setup.ins | ||
- | `-- uninstall.ins | ||
- | </ | ||
- | |||
- | == What is does, and what not == | ||
- | It Does:\\ | ||
- | - **Setup** installing default config (.pow file) | ||
- | - **Uninstall** remove default config (.pow file) and set to selected property " | ||
- | - **Once** customize the default config (.pow file), with the product propertys (values in minutes): | ||
- | - monitor-timeout-ac | ||
- | - monitor-timeout-dc | ||
- | - disk-timeout-ac | ||
- | - disk-timeout-dc | ||
- | - standby-timeout-ac | ||
- | - standby-timeout-dc | ||
- | |||
- | It Does Not:\\ | ||
- | - Working for Windows XP | ||
- | - Turn your computer into an energy-saving-machine | ||
- | - Report any errors, to winst. | ||
- | |||
- | |||
- | == TODO == | ||
- | - May add Exception-Handling/ | ||
- | |||
- | |||
- | ===== delsub.ins ===== | ||
- | <code winst check_uninstall.ins> | ||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_high_performance$ | ||
- | endif | ||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_powersave$ | ||
- | endif | ||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_balanced$ | ||
- | endif | ||
- | |||
- | Message "Reset to: " + $reset_to$ + " (" + $reset_to_guid$ + " | ||
- | WinBatch_reset_to | ||
- | |||
- | Message " | ||
- | WinBatch_Delete | ||
- | |||
- | |||
- | |||
- | |||
- | [WinBatch_reset_to] | ||
- | powercfg -SETACTIVE " | ||
- | |||
- | [WinBatch_Delete] | ||
- | powercfg -DELETE " | ||
- | |||
- | </ | ||
- | |||
- | === once.ins === | ||
- | <code winst delsub.ins> | ||
- | [Initial] | ||
- | setLogLevel=9 | ||
- | ExitOnError=True | ||
- | ScriptErrorMessages=on | ||
- | TraceMode=off | ||
- | StayOnTop=True | ||
- | |||
- | [Actions] | ||
- | Message " | ||
- | DefVar $guid$ | ||
- | DefVar $guid_balanced$ | ||
- | DefVar $guid_high_performance$ | ||
- | DefVar $guid_powersave$ | ||
- | DefVar $name$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $OS$ | ||
- | DefVar $TEMP$ | ||
- | DefVar $MinorOS$ | ||
- | DefVar $reset_to$ | ||
- | DefVar $reset_to_guid$ | ||
- | DefVar $monitor-timeout-ac$ | ||
- | DefVar $monitor-timeout-dc$ | ||
- | DefVar $disk-timeout-ac$ | ||
- | DefVar $disk-timeout-dc$ | ||
- | DefVar $standby-timeout-ac$ | ||
- | DefVar $standby-timeout-dc$ | ||
- | |||
- | Set $reset_to$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-ac$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-dc$ = GetProductProperty ( " | ||
- | Set $disk-timeout-ac$ = GetProductProperty ( " | ||
- | Set $disk-timeout-dc$ = GetProductProperty ( " | ||
- | Set $standby-timeout-ac$ = GetProductProperty ( " | ||
- | Set $standby-timeout-dc$ = GetProductProperty ( " | ||
- | |||
- | set $ProductId$ = " | ||
- | set $OS$ = GetOS | ||
- | Set $TEMP$ = " | ||
- | set $MinorOS$ = GetNTVersion | ||
- | Set $guid_balanced$ = " | ||
- | Set $guid_high_performance$ = " | ||
- | Set $guid_powersave$ = " | ||
- | |||
- | Set $name$ = "FAW gGmbH" | ||
- | Set $guid$ = " | ||
- | |||
- | ShowBitmap " | ||
- | |||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_high_performance$ | ||
- | endif | ||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_powersave$ | ||
- | endif | ||
- | if $reset_to$ = " | ||
- | Set $reset_to_guid$ = $guid_balanced$ | ||
- | endif | ||
- | |||
- | sub " | ||
- | |||
- | Message " | ||
- | Files_copy_data | ||
- | WinBatch_Import | ||
- | Files_delete_data | ||
- | |||
- | Message "Set Active: " + $name$ + " ( " + $guid$ + " | ||
- | WinBatch_set_active | ||
- | |||
- | Message " | ||
- | WinBatch_change | ||
- | |||
- | Message " | ||
- | |||
- | |||
- | |||
- | |||
- | [Files_copy_data] | ||
- | copy " | ||
- | |||
- | [Files_delete_data] | ||
- | delete -f " | ||
- | |||
- | [WinBatch_Import] | ||
- | powercfg -IMPORT " | ||
- | |||
- | [WinBatch_set_active] | ||
- | powercfg -SETACTIVE $guid$ | ||
- | |||
- | [WinBatch_change] | ||
- | powercfg -CHANGE -monitor-timeout-ac " | ||
- | powercfg -CHANGE -monitor-timeout-dc " | ||
- | powercfg -CHANGE -disk-timeout-ac " | ||
- | powercfg -CHANGE -disk-timeout-dc " | ||
- | powercfg -CHANGE -standby-timeout-ac " | ||
- | powercfg -CHANGE -standby-timeout-dc " | ||
- | |||
- | </ | ||
- | |||
- | === setup.ins === | ||
- | <code winst setup.ins> | ||
- | [Initial] | ||
- | setLogLevel=9 | ||
- | ExitOnError=True | ||
- | ScriptErrorMessages=on | ||
- | TraceMode=off | ||
- | StayOnTop=True | ||
- | |||
- | [Actions] | ||
- | Message " | ||
- | DefVar $guid$ | ||
- | DefVar $guid_balanced$ | ||
- | DefVar $guid_high_performance$ | ||
- | DefVar $guid_powersave$ | ||
- | DefVar $name$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $OS$ | ||
- | DefVar $TEMP$ | ||
- | DefVar $MinorOS$ | ||
- | DefVar $reset_to$ | ||
- | DefVar $reset_to_guid$ | ||
- | DefVar $monitor-timeout-ac$ | ||
- | DefVar $monitor-timeout-dc$ | ||
- | DefVar $disk-timeout-ac$ | ||
- | DefVar $disk-timeout-dc$ | ||
- | DefVar $standby-timeout-ac$ | ||
- | DefVar $standby-timeout-dc$ | ||
- | |||
- | Set $reset_to$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-ac$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-dc$ = GetProductProperty ( " | ||
- | Set $disk-timeout-ac$ = GetProductProperty ( " | ||
- | Set $disk-timeout-dc$ = GetProductProperty ( " | ||
- | Set $standby-timeout-ac$ = GetProductProperty ( " | ||
- | Set $standby-timeout-dc$ = GetProductProperty ( " | ||
- | |||
- | set $ProductId$ = " | ||
- | set $OS$ = GetOS | ||
- | Set $TEMP$ = " | ||
- | set $MinorOS$ = GetNTVersion | ||
- | Set $guid_balanced$ = " | ||
- | Set $guid_high_performance$ = " | ||
- | Set $guid_powersave$ = " | ||
- | |||
- | Set $name$ = "FAW gGmbH" | ||
- | Set $guid$ = " | ||
- | |||
- | ShowBitmap " | ||
- | |||
- | sub " | ||
- | |||
- | Message " | ||
- | Files_copy_data | ||
- | WinBatch_Import | ||
- | Files_delete_data | ||
- | |||
- | Message "Set Active: " + $name$ + " ( " + $guid$ + " | ||
- | WinBatch_set_active | ||
- | |||
- | Message " | ||
- | |||
- | |||
- | |||
- | |||
- | [Files_copy_data] | ||
- | copy " | ||
- | |||
- | [Files_delete_data] | ||
- | delete -f " | ||
- | |||
- | [WinBatch_Import] | ||
- | powercfg -IMPORT " | ||
- | |||
- | [WinBatch_set_active] | ||
- | powercfg -SETACTIVE $guid$ | ||
- | |||
- | </ | ||
- | |||
- | === uninstall.ins === | ||
- | <code winst uninstall.ins> | ||
- | [Initial] | ||
- | setLogLevel=9 | ||
- | ExitOnError=True | ||
- | ScriptErrorMessages=on | ||
- | TraceMode=off | ||
- | StayOnTop=True | ||
- | |||
- | [Actions] | ||
- | Message " | ||
- | DefVar $guid$ | ||
- | DefVar $guid_balanced$ | ||
- | DefVar $guid_high_performance$ | ||
- | DefVar $guid_powersave$ | ||
- | DefVar $name$ | ||
- | DefVar $ProductId$ | ||
- | DefVar $OS$ | ||
- | DefVar $TEMP$ | ||
- | DefVar $MinorOS$ | ||
- | DefVar $reset_to$ | ||
- | DefVar $reset_to_guid$ | ||
- | DefVar $monitor-timeout-ac$ | ||
- | DefVar $monitor-timeout-dc$ | ||
- | DefVar $disk-timeout-ac$ | ||
- | DefVar $disk-timeout-dc$ | ||
- | DefVar $standby-timeout-ac$ | ||
- | DefVar $standby-timeout-dc$ | ||
- | |||
- | Set $reset_to$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-ac$ = GetProductProperty ( " | ||
- | Set $monitor-timeout-dc$ = GetProductProperty ( " | ||
- | Set $disk-timeout-ac$ = GetProductProperty ( " | ||
- | Set $disk-timeout-dc$ = GetProductProperty ( " | ||
- | Set $standby-timeout-ac$ = GetProductProperty ( " | ||
- | Set $standby-timeout-dc$ = GetProductProperty ( " | ||
- | |||
- | set $ProductId$ = " | ||
- | set $OS$ = GetOS | ||
- | Set $TEMP$ = " | ||
- | set $MinorOS$ = GetNTVersion | ||
- | Set $guid_balanced$ = " | ||
- | Set $guid_high_performance$ = " | ||
- | Set $guid_powersave$ = " | ||
- | |||
- | Set $name$ = "FAW gGmbH" | ||
- | Set $guid$ = " | ||
- | |||
- | ShowBitmap " | ||
- | |||
- | sub " | ||
- | |||
- | Message " | ||
- | |||
- | </ | ||
- | |||
- | === control === | ||
- | <code winst control> | ||
- | [Package] | ||
- | version: 1 | ||
- | depends: | ||
- | incremental: | ||
- | |||
- | [Product] | ||
- | type: localboot | ||
- | id: win-config-power | ||
- | name: win-config-power | ||
- | description: | ||
- | advice: costomize default config with " | ||
- | version: 1.0 | ||
- | priority: 0 | ||
- | licenseRequired: | ||
- | productClasses: | ||
- | setupScript: | ||
- | uninstallScript: | ||
- | updateScript: | ||
- | alwaysScript: | ||
- | onceScript: once.ins | ||
- | customScript: | ||
- | userLoginScript: | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: reset_to | ||
- | multivalue: True | ||
- | editable: False | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: monitor-timeout-ac | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: monitor-timeout-dc | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: disk-timeout-ac | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: disk-timeout-dc | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: standby-timeout-ac | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [ProductProperty] | ||
- | type: unicode | ||
- | name: standby-timeout-dc | ||
- | multivalue: True | ||
- | editable: True | ||
- | values: [" | ||
- | default: [" | ||
- | |||
- | [Changelog] | ||
- | win-config-power (1.0-1) testing; urgency=low | ||
- | -- Kevin Weis < | ||
- | * Use " | ||
- | * Use " | ||
- | * Use " | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | * Tested with Windows 7 Enterprise and Windows 8.1 Professional | ||
- | |||
- | </ |