I read documents about function to pass information or to pass parameter for function what you sent me but i don't understand and I don't write source code, i want you help me write source code. I have 2 question want to question, distribute 2 case. This my example simple about delete key.
case:
1. I want to write function all delete fonts Tahoma.ttf and Tahomabd.ttf as DeleteRegValue but i can't delete them, can you help me ? My soure code or you see attach file AllDeleteFont.nsi, If i want to debug (or see) variable environment, i can see content variable environment, can i ? as $Pathkey, $fontkey, $0, $1,... ? what do i do ?
Var PathKey
Var FontKey
Function AllDeleteRegValue
#All delete fonts Tahoma.ttf and Tahomabd.ttf into registry
StrCpy $0 0
loop: #All delete Tahoma.ttf and Tahomabd.ttf
ClearErrors
EnumRegValue $1 HKLM PathKey $0
IfErrors done
IntOp $0 $0 + 1
# Copy font names: Tahoma.ttf (or Tahomabd.ttf) into $2 and compare $2 if equal Tahoma.ttf is delete them
StrCpy $2 $1 "" -StrLen(FontKey) #
StrCmp $2 FontKey 0 +3
DeleteRegValue HKLM PathKey $1
StrCpy $0 0
goto +2
; # Copy font names: Tahoma.ttf (or Tahomabd.ttf) into $2 and compare $2 if equal Tahoma.ttf is delete them
; StrCpy $3 $1 "" -12 #
; StrCmp $2 "Tahomabd.ttf" 0 +3
; DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\SharedDlls" $1
; StrCpy $0 0
; goto +1
goto loop
done:
#All delete fonts Tahoma.ttf and Tahomabd.ttf into registry
FunctionEnd
Section
StrCpy $FontKey "Tahoma.ttf"
StrCpy $PathKey "Software\Microsoft\Windows\CurrentVersion\SharedDlls"
Call AllDeleteRegValue
StrCpy $FontKey "Tahomabd.ttf"
Call AllDeleteRegValue
SectionEnd
+++++++++++++++++++++++
Case 2:
2. If i want to write function AllDeleteRegValue as DeleteRegValue to pass parameter.
AllDeleteRegValue HKLM "Software\My Company\My Software" "Tahoma.ttf"
In Section i write, can i write them ? can you help me ?
Function AllDeleteRegValue (PathKey, FontKey)
... Command
FunctionEnd
Section
AllDeleteRegValue HKLM "Software\My Company\My Software" "Tahoma.ttf"
AllDeleteRegValue HKLM "Software\My Company\My Software" "Tahomabd.ttf"
SectionEnd
- I can't send attach file because i don't see button attach file, I will copy content file, the name file AllDeleteFont.nsi
# All delete fonts
Name "All Delete Fonts"
Caption "All Delete Fonts"
OutFile "AllDeleteFonts.exe"
Var PathKey
Var FontKey
Function AllDeleteRegValue
#All delete fonts Tahoma.ttf and Tahomabd.ttf into registry
StrCpy $0 0
loop: #All delete Tahoma.ttf and Tahomabd.ttf
ClearErrors
EnumRegValue $1 HKLM PathKey $0
IfErrors done
IntOp $0 $0 + 1
# Copy font names: Tahoma.ttf (or Tahomabd.ttf) into $2 and compare $2 if equal Tahoma.ttf is delete them
StrCpy $2 $1 "" -StrLen(FontKey) #
StrCmp $2 FontKey 0 +3
DeleteRegValue HKLM PathKey $1
StrCpy $0 0
goto +2
; # Copy font names: Tahoma.ttf (or Tahomabd.ttf) into $2 and compare $2 if equal Tahoma.ttf is delete them
; StrCpy $3 $1 "" -12 #
; StrCmp $2 "Tahomabd.ttf" 0 +3
; DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\SharedDlls" $1
; StrCpy $0 0
; goto +1
goto loop
done:
#All delete fonts Tahoma.ttf and Tahomabd.ttf into registry
FunctionEnd
Section
StrCpy $FontKey "Tahoma.ttf"
StrCpy $PathKey "Software\Microsoft\Windows\CurrentVersion\SharedDlls"
Call AllDeleteRegValue
StrCpy $FontKey "Tahomabd.ttf"
Call AllDeleteRegValue
SectionEnd