Toggle Add/Remove Programs (W2K): Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(4)
m (Reverted edits by 194.54.35.197 to last version by Kichik)
 
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
http://nude-wet-girlz.com/big/latex-gloves-for-sale latex gloves for sale . http://sexy-latin2008.com/sel/smile-now-cry-later-symbol smile now cry later symbol . http://xxx-sexy-girlz.com/hot/goody-bag-treat goody bag treat .  136203
{{PageAuthor|fade8}}
 
== Description ==
Tested with Windows 2000 as a restricted user.  Toggles Add/Remove programs on the fly.
== The Script ==
<highlight-nsis>
; Toggle Add/Remove Programs for Windows 2000, XP and Win98
; Example by fade8,  laibr@wyeth.com
 
Name "AddRemoveTest"
OutFile "ToggleAddRemove.exe"
SetFont "Verdana" 9
SilentInstall Silent
 
BrandingText /TRIMCENTER "Toggle Add/Remove Programs"
Caption "Toggle Add/Remove Programs"
 
FileErrorText "Something unexpected happened.\nCan not read-write the file
$\r$\n$0$\r$\n"
AutoCloseWindow True
 
Function .onInit
;  Call isAdmin
FunctionEnd
 
Section "Install"
 
ReadRegDWORD $0 HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms"
 
StrCmp $0 0 0 +4
WriteRegDWORD HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms" "00000001"
MessageBox MB_OK "Add Remove Programs disabled!"
Goto +3
WriteRegDWORD HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms" "00000000"
MessageBox MB_OK "Add Remove Programs enabled!"
 
SectionEnd
</highlight-nsis>
Hope its useful.
-Brandon L
laibr@wyeth.com
 
[[Category:Code Examples]]

Latest revision as of 21:40, 28 November 2007

Author: fade8 (talk, contrib)


Description

Tested with Windows 2000 as a restricted user. Toggles Add/Remove programs on the fly.

The Script

; Toggle Add/Remove Programs for Windows 2000, XP and Win98
; Example by fade8,  laibr@wyeth.com
 
Name "AddRemoveTest"
OutFile "ToggleAddRemove.exe"
SetFont "Verdana" 9
SilentInstall Silent
 
BrandingText /TRIMCENTER "Toggle Add/Remove Programs"
Caption "Toggle Add/Remove Programs"
 
FileErrorText "Something unexpected happened.\nCan not read-write the file
$\r$\n$0$\r$\n"
AutoCloseWindow True
 
 Function .onInit
;  Call isAdmin
 FunctionEnd
 
Section "Install" 
 
ReadRegDWORD $0 HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms"
 
StrCmp $0 0 0 +4
WriteRegDWORD HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms" "00000001"
MessageBox MB_OK "Add Remove Programs disabled!"
Goto +3
WriteRegDWORD HKCU
Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall
"NoAddRemovePrograms" "00000000"
MessageBox MB_OK "Add Remove Programs enabled!"
 
SectionEnd

Hope its useful. -Brandon L laibr@wyeth.com