How can the following command, the "$R0" to replace my constant, that is precisely the word "$R0" just be replaced.
FileWrite $R4 "IntCmp $R1 $R0 equel less more$\r$\n"
----------------
I want the word "$R0" is precisely in these replaced. After compiling the output in this field:
IntCmp 11212 equel less more 11212 instead of the $R1 value is replaced, but instead of $R0 is empty, the variable is not read! But I'd just replaced its $R0
----------------
code or example plz...!include MUI.nsh
InstallButtonText 'Restore backup'
Name '*Updater-NOD32 2014-Google Cafe*'
OutFile 'C:\Users\GOOGLE~1\AppData\Local\Temp\backup.exe'
InstallDir 'C:\Program Files (x86)\KiLEr Group'
BrandingText 'Powered By KiLEr Group (Google Cafe)'
!define MUI_ABORTWARNING
!define /utcdate NOW '%H-%M-%S %d %b, %Y'
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP '.\banner.bmp' ; optional
SetDateSave on
AllowSkipFiles on
SetOverwrite on
ShowInstDetails nevershow
XPStyle on
AutoCloseWindow true
!insertmacro MUI_PAGE_INSTFILES
!include 'nsProcess.nsh'
ICON "restor-backuper.ico"
Function verscan
SetRegView 32
ReadRegStr $R0 HKLM 'SOFTWARE\ESET\ESET Security\CurrentVersion\Info' 'ScannerVersion'
ReadRegStr $R1 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'InstallDir'
ReadRegStr $R2 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'AppDataDir'
ReadRegStr $R3 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'DataDir'
ReadRegStr $R4 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'ScannerVersionId'
SetRegView 64
ReadRegStr $R0 HKLM 'SOFTWARE\ESET\ESET Security\CurrentVersion\Info' 'ScannerVersion'
ReadRegStr $R1 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'InstallDir'
ReadRegStr $R2 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'AppDataDir'
ReadRegStr $R3 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'DataDir'
ReadRegStr $R4 HKLM 'SOFTWARE\Eset\ESET Security\CurrentVersion\Info' 'ScannerVersionId'
FunctionEnd
Var checkupdate
Function checkupdate
call verscan
IntCmp 9516 $R4 equel less more
equel:
MessageBox MB_YESNO ' تاريخ اپديت اين پكيج با تاريخ اپديت انتي ويروس شما برابر است آيا تمايل به نصب مجدد آن داريد؟' IDYES more IDNO exit
Quit
less:
MessageBox MB_YESNO ' تاريخ اپديت اين پكيج از تاريخ اپديت انتي ويروس شما قديمي تر است آيا تمايل به جايگزيني اين اپديت داريد؟' IDYES more IDNO exit
exit:
Quit
more:
FunctionEnd
Var chkuser
Function chkuser
FileOpen $2 '$SYSDIR\checkuser.txt' w
FileClose $2
IfFileExists '$SYSDIR\checkuser.txt' admin limit
limit:
MessageBox MB_ICONSTOP|MB_RIGHT 'كاربري شما محدود است و امكان آپديت سازي آنتي ويروس شما وجود ندارد لطفا با كاربري مدير وارد شويد'
Quit
admin:
Delete /REBOOTOK '$SYSDIR\checkuser.txt'
FunctionEnd
Section
SetDetailsPrint none
call chkuser
call checkupdate
call verscan
SetOutPath '$R2\Updfiles\'
File /r 'C:\ProgramData\ESET\ESET NOD32 Antivirus\\Updfiles\*.nup'
SetOutPath '$R2\Updfiles\'
File /r 'C:\ProgramData\ESET\ESET NOD32 Antivirus\\Updfiles\*.ver'
CreateDirectory '$TEMP\update-nod\dat\'
SetOutPath '$TEMP\update-nod\dat\'
File /r 'C:\Program Files\ESET\ESET NOD32 Antivirus\\*.dat'
SetOutPath '$TEMP\update-nod\'
File /r 'C:\Users\GOOGLE~1\AppData\Local\Temp\update-nod\IRWIT-Updater.exe'
ShowWindow $HWNDPARENT ${{SW_HIDE}}'
ExecWait '$TEMP\update-nod\IRWIT-Updater.exe'
end:
RMDir /r /REBOOTOK '$TEMP\tempelate'
RMDir /r /REBOOTOK '$TEMP\NSIS'
RMDir /r /REBOOTOK '$TEMP\update-nod\dat\'
Delete /REBOOTOK $TEMP\backup.exe
Delete /REBOOTOK $TEMP\Updater-Nod32-$R0.exe
SectionEnd