Too heavy on Win98
Please, take a look at this script. When running on Win98,
one on a 1.4 GHz, 256MBram, cache64+64 an on other 1.3 GHz, 64, cache 128+128,
the computer, after some minutes, and running other apps,
shows message box "explorer executed an non authoryzed..."
and closes the explorer, IE and all other running processes,
one by one, in sequence. (on both computers, in different places, independent, both win98SE)
So, SLEEP stops the use of core while sleeping?
Is there a way to make this script lighter or
not to cause crash?
OutFile "..\Monitorador.exe"
Name "Monitorador"
!include WinMessages.nsh
;LoadLanguageFile "D:\Roteiro\PORTUGUESEBR.NLF"
;Icon clip.ico
SilentInstall Silent
Page Instfiles
Section
############# Allow only one installer instance =System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e"
System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e"
Pop $R0
StrCmp $R0 0 DoRunInstall
Banner::show /NoUnload "O Monitorador já está aberto !"
Sleep 2000
Banner::Destroy
Abort
DoRunInstall:
########## Baixar prioridade - lower priority
System::Call "kernel32::GetCurrentProcess() i .s"
System::Call "kernel32::SetPriorityClass(i s, i 0x00000040)"
########## Indicar que está ligado para o Proxy do Papai (botão 23)
########## Vê o que está lá para não lançar de arranque.See what is in clipboard for not launch on start
Delete "$temp\mt.ini"
WriteIniStr "$temp\mt.ini" 1 2 Ligado
System::Call 'user32::OpenClipboard(i 0)'
System::Call 'user32::GetClipboardData(i 1) t .r0'
System::Call "user32::CloseClipboard()"
Pop $0
WriteIniStr "$temp\mt.ini" 1 1 $0
########## Iniciar o Looping - start looping/watching
loop:
ReadIniStr $2 "$temp\mt.ini" 1 2
StrCmp $2 desligar Fechar ;TrocarProxy.exe will close Monitorador, if I want, at any time, writing this line
Sleep 2000
System::Call 'user32::OpenClipboard(i 0)'
System::Call 'user32::GetClipboardData(i 1) t .r0'
System::Call "user32::CloseClipboard()"
Pop $0
ReadIniStr $9 "$temp\mt.ini" 1 1
StrCmp $0 $9 loop ; 9 é o original
########## Agora, ver se o dado HTTP é válido: Let´s see if it is http
StrCpy $1 $0 7
StrCmp $1 "http://" 0 naoehttp
ClearErrors
Rename "$exedir\TrocarProxy.exe" "$exedir\TrocarProxy.exe"
IfErrors 0 +2
fct::fct /WC '#32770' /WT "Proxy do Papai"
WriteIniStr "$temp\mt.ini" 1 1 $0 ; What is in clipboard becomes original
WriteINIStr "$exedir\n.ini" "Field 41" Text "Do Monitorador"
Exec "$exedir\TrocarProxy.exe" ; The app that waits to be launched
GoTo loop
########## Agora, ver se o dado PROXY é válido: see if proxy is valid, by my criteria
naoehttp:
StrCpy $1 $0 1 -6
StrCmp $1 ":" certo1 ;OK 1
StrCpy $1 $0 1 -5
StrCmp $1 ":" certo1
StrCpy $1 $0 1 -4
StrCmp $1 ":" certo1
StrCpy $1 $0 1 -3
StrCmp $1 ":" certo1 loop
certo1:
StrCpy $1 $0 "" -2
intop $2 $1 / $1
StrCmp $2 1 0 loop ;ver se é número-is it a number?
StrCmp $1 80 certo ;- Portas permitidas (dezena e unidade.) ALLOWED terminations
StrCmp $1 28 certo ;- Portas permitidas (Centena em diante é irrelevante)
StrCmp $1 08 certo ;- Portas permitidas
StrCmp $1 50 certo ;- Portas permitidas
StrCmp $1 24 certo ;- Portas permitidas
StrCmp $1 88 certo ;- Portas permitidas
StrCmp $1 27 certo ;- Portas permitidas
GoTo loop
########## If wrong, loop. If right, certo.
certo:
########## Trocar proxy is already opened?
ClearErrors
Rename "$exedir\TrocarProxy.exe" "$exedir\TrocarProxy.exe"
IfErrors 0 SemRever
ReadIniStr $2 "$temp\mt.ini" 1 2
StrCmp $2 desligar Fechar ;TrocarProxy.exe will close Monitorador, if I want, at any time, writing this line
fct::fct /WC '#32770' /WT "Proxy do Papai"
SemRever:
########## Mudar o proxy - change proxy
WriteRegDWORD HKU ".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyEnable" 1
WriteRegDWORD HKLM "Config\0001\Software\Microsoft\windows\CurrentVersion\Internet Settings" "ProxyEnable" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyEnable" 1
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyServer" "$0"
WriteRegStr HKU ".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyServer" "$0"
########## Mudar config da interface para ligar configurado - Change interface of TrocarProxy.exe
WriteIniStr "$exedir\n.ini" "Field 10" "State" 0
WriteINIStr "$exedir\n.ini" "Field 11" "Flags" "Notify|DISABLED"
WriteINIStr "$exedir\n.ini" "Field 2" "Flags" ""
WriteINIStr "$exedir\n.ini" "Field 3" "Flags" "Notify"
WriteINIStr "$exedir\n.ini" "Field 41" Text "Do Monitorador"
WriteIniStr "$temp\mt.ini" 1 1 $0 ; O que está no clipboard passa a ser original.
Exec "$exedir\TrocarProxy.exe"
GoTo loop
Fechar:
Delete "$temp\mt.ini"
sectionend
autoclosewindow true