Difference between revisions of "Adding Registry Settings"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
m
Line 1: Line 1:
 
You can use regedit to import registry settings. This can be useful to setup defaults for applications, or apply  
 
You can use regedit to import registry settings. This can be useful to setup defaults for applications, or apply  
 
[http://www.winguides.com/registry/ registry tweaks for various Windows settings].
 
[http://www.winguides.com/registry/ registry tweaks for various Windows settings].
 
+
<pre>
 
  <package
 
  <package
 
     id="sample_registry"
 
     id="sample_registry"
Line 8: Line 8:
 
     priority="0"
 
     priority="0"
 
     execute="once">
 
     execute="once">
+
  <check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\Test" value="1" />
  <install cmd='regedit /s "%SOFTWARE%\test_registry.reg"' />
+
  <install cmd='regedit /s "%SOFTWARE%\test_registry.reg"' />
+
 
  </package>
 
  </package>
 
+
</pre>
  
 
And the sample file:
 
And the sample file:
  
 
<code>test_registry.reg</code>:
 
<code>test_registry.reg</code>:
  Windows Registry Editor Version 5.00
+
  <nowiki>Wstaw tu tekst niesformatowany</nowiki>
 +
<pre>
 +
��Windows Registry Editor Version 5.00
 
   
 
   
 
  [HKEY_LOCAL_MACHINE\SOFTWARE\Test]
 
  [HKEY_LOCAL_MACHINE\SOFTWARE\Test]
 
  "Test Setting"=dword:00000001
 
  "Test Setting"=dword:00000001
 
  [-HKEY_LOCAL_MACHINE\SOFTWARE\TEST2]
 
  [-HKEY_LOCAL_MACHINE\SOFTWARE\TEST2]
 
+
</pre>
 
(In Win2k/XP adding "-" in front of a key name causes that key to be deleted from the registry.)
 
(In Win2k/XP adding "-" in front of a key name causes that key to be deleted from the registry.)
  

Revision as of 17:31, 24 January 2008

You can use regedit to import registry settings. This can be useful to setup defaults for applications, or apply registry tweaks for various Windows settings.

 <package
     id="sample_registry"
     name="Shows a registry entry"
     revision="1"
     priority="0"
     execute="once">
   <check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\Test" value="1" />
   <install cmd='regedit /s "%SOFTWARE%\test_registry.reg"' />
 </package>

And the sample file:

test_registry.reg:

Wstaw tu tekst niesformatowany
��Windows Registry Editor Version 5.00
 
 [HKEY_LOCAL_MACHINE\SOFTWARE\Test]
 "Test Setting"=dword:00000001
 [-HKEY_LOCAL_MACHINE\SOFTWARE\TEST2]

(In Win2k/XP adding "-" in front of a key name causes that key to be deleted from the registry.)

Normally, you would export this from regedit.exe.