Archive: Too heavy on Win98


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


I think would help if you disable this 'SilentInstall Silent' and enable 'ShowInstDetails show' to see if the target systems crash at the same point of script execution.

BTW what exactly does this:
Rename "$exedir\TrocarProxy.exe" "$exedir\TrocarProxy.exe"


might be unrelated, but some of my scripts only worked properly on win9x if i used "s for all variables


Rename trocarproxy.exe trocarproxy.exe
is the most safe way to see if trocarproxy.exe is
currently running. I tryied all other ways but,
early or later, fails.
Rename a file by itself NEVER FAILED.

This crash only happens when this script is active,
and almost always. (not ALL the times.)

It always crashes when screensave activates.

It always crashes when Explorer.exe (or IE, or IE and Explorer.exe) is on and I open
Excell (2K) AND Word (2K).

What you Mean? Is it like put a detailprint after each
action to see if the crash occurs always at the same point?
I think I´ll try to write this on registry or inifile, because when it crashes, I can do nthing else but press
reset (that buton that indian woman have above and between the eyes).


Tell me more. How "s ?
Is it
var s1
var s2 ;etc
instead of $1, $2 etc ?


Tell me more. How "s ?
Is it
var s1
var s2 ;etc
instead of $1, $2 etc ?


Undesrstood you question.
Rename itself, in this case, is useless.
That´s because there WAS a MB_YESNO after IfErrors,
asking if close it and restart or leave as is.
Now, only closes TrocarProxy.exe.

PLEASE !


For me is difficult reading a script to follow the the logic and determine if there is something improper or incorrect, plus I haven't access to any 9x/Me machine so I can't go further with this.
So all I can say is what I'd do if I had the problem, try to debug it.

BTW In my neighborhood lives a family from India (you know India? that big country in south Asia with the ancient civilization), these people are my friends, I can assure you that aside from the fact that they are nice and gently persons, they look ordinary (no buttons).


Thank you.
I'll try this.