Sign in to follow this  
Followers 0
urian

URGENT:Problem with regread...

4 posts in this topic

Hello, ther first sorry for my english.

I try conver a batch script to autoit but i dont undernstand...

I attached the batch.

My first problem is with regread because i need read a key, if the .framework2.0 is installed pass but if not installed call a .exe that is .net2.0

Later i need do the same witch adobe and the last i need to see the operating system (in value reg) if i find vista on a specific value in the reg execute a .exe if not i execute other .exe

My script i think starts $var = RegRead ("HKLM\SOFTWARE\Microsoft\.NETFRAMEWORK\v2.0.50727")

if the $var is error (not installed .net) goto exe, if the $var is ok (goto the next step)

Can you help me please.

Thank you very much in advance.

If you need my email is urian84@gmail.com

autorun.txt

Share this post


Link to post
Share on other sites



I ran out of time for I have to do something, but this is what I have so far.

$RegistryPathForDotNetDetection = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727"
$RegistryPathForAdobeDetection = "HKEY_LOCAL_MACHINE\SOFTWARE\ADOBE\ACROBAT READER"
$regread1 = RegRead($RegistryPathForDotNetDetection, "Install")
$regread2 = RegRead($RegistryPathForAdobeDetection, "")
if $regread1 = 1 or $regread = 2 then 
    runwait(@ScriptDir&'\Prerequisitos\framework2.0\dotnetfx.exe /c:"install /l')
EndIf
if $regread2 = -1 then 
    runwait('msiexec /i '&@ScriptDir&'"\Prerequisitos\Reader\AcroRead.msi" ALLUSERS=TRUE TRANSFORMS="\Prerequisitos\Reader\AcroRead.mst" /QB') ;hope that works. NOT TESTED
EndIf

The following is what I didn't get through, but someone else may be able to help you the rest of the way.

:ver_install
FOR /F "skip=2" %%G IN ('REG QUERY "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION" /v "Productname"') DO SET _sistema=%%G

echo %_sistema% |find "Vista"
IF %ERRORLEVEL%== 0 (goto ver_vista) ELSE (goto ver_xp)


:ver_vista
start setup.exe
echo Windows Vista
goto exit


:ver_xp
regsvr32 /s ".\Busqueda general\Alchemy\auapix.dll"
START (.\revista.exe)

echo Windows XP

:exit

Share this post


Link to post
Share on other sites

god! youre a best fck developer hehe

This is a installation cd for my job (i need for tomorrow or next) and i imagine that the next part of script is similar to yours.

I try this moment but im very bad, i go to begin to study autoit though the documentation is explained little.

Thanks :-D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0