Archive: Need help on detecting if Adobe AIR is installer


Need help on detecting if Adobe AIR is installer
Hello...i´m trying to make an installer that is capable to detect if Adobe AIR is installed...

Looked into the registry and have found two keys that holds the Adobe Air data.

[HKEY_CLASSES_ROOT\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC]

both with the same data in each.

So i have found this code to detect the path and version of Adobe Flash IE Plugin


Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro GetFileVersion

Section
ReadRegStr $0 HKLM "SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC" "ProductName"
IfErrors notinst
${GetFileVersion} '$0' $1
IfErrors notinst

MessageBox MB_OK '$$0={$0}$\n$$1={$1}' IDOK end

notinst:
MessageBox MB_OK 'Macromedia Flash Player component for IE is not found, Valor $$0=$0'

end:
SectionEnd


And if you see...i´m trying to read that Key, but the awful result is an empty string ans the error set to true

I have included the key export to reg file for you to see...

Please advise.

Thanks a lot!

EDIT: I dont know whit the attachment is gone...

Here is the registry export.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC]
"ProductName"="Adobe Integrated Runtime (AIR)"
"PackageCode"="99E592108416019478501F9180E3C1ED"
"Language"=dword:00000409
"Version"=dword:01000005
"Assignment"=dword:00000001
"AdvertiseFlags"=dword:00000184
"InstanceType"=dword:00000000
"AuthorizedLUAApp"=dword:00000000
"Clients"=hex(7):3a,00,00,00,00,00
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC\SourceList]
"PackageName"="setup.msi"
"LastUsedSource"=hex(2):6e,00,3b,00,31,00,3b,00,43,00,3a,00,5c,00,44,00,4f,00,\
43,00,55,00,4d,00,45,00,7e,00,31,00,5c,00,4d,00,61,00,72,00,74,00,69,00,6e,\
00,5c,00,4c,00,4f,00,43,00,41,00,4c,00,53,00,7e,00,31,00,5c,00,54,00,65,00,\
6d,00,70,00,5c,00,41,00,49,00,52,00,32,00,39,00,2e,00,74,00,6d,00,70,00,5c,\
00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC\SourceList\Media]
"1"=";"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC\SourceList\Net]
"1"=hex(2):43,00,3a,00,5c,00,44,00,4f,00,43,00,55,00,4d,00,45,00,7e,00,31,00,\
5c,00,4d,00,61,00,72,00,74,00,69,00,6e,00,5c,00,4c,00,4f,00,43,00,41,00,4c,\
00,53,00,7e,00,31,00,5c,00,54,00,65,00,6d,00,70,00,5c,00,41,00,49,00,52,00,\
32,00,39,00,2e,00,74,00,6d,00,70,00,5c,00,00,00

Forgive me if I miss something, I see you're attempting to read the value of ProductName which is Adobe Integrated Runtime (AIR) and call the function ${GetFileVersion} to get the version of what?

However, those registry records, obviously they are related to windows installer, you should find records related to adobe.


Hello..thanks for the advise...

The line ${GetFileVersion} was there in the original script,
obviously i dont want to get the file version.

Also, since adobe AIR is so new, i dont know were it places the registry entryes...So the only key that has some sense to check his availability is that two keys.

Perhaps, the error i get is that i can not read the key, the value is an empty string and the error state is set to true...

Please advise.


The registry path SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC appears to be incorrect according to your reg file.

Stu


Hello guys...

Sorry if i´m wrong, but i still don´t get it...So please advise if i´m wrong...

I think if i use this sentence

ReadRegStr $0 HKLM "SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80F6BC49FC" "ProductName"


I can read this value "Adobe Integrated Runtime (AIR)" stored in the entry "ProductName" of this branch "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D51CF99160E2EB743BAEAC80
F6BC49FC"

Thanks in advise...

for me this works:

ReadRegDWORD $0 HKCU "Software\Microsoft\Installer\Products\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "Version"


however, the part where i put XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is different to what you posted, so this might be randomly created by the installer. i think the registry plugin can locate keys in the registry. however, the GetFileVersion function is meant to work with files, if i'm not mistaken. that'S why i was reading the version key instead, but the result leaves me somewhat clueless (maybe you can read more from it?)

this can't be the only registry entry it creates, does it create a normal uninstall entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\?


Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro "Locate"

Section
${Locate} "$LOCALAPPDATA\Adobe AIR\Versions" "/L=D" "found"
; whatever you want to use the result for here
SectionEnd

Function found
MessageBox MB_OK "Version is $R7"

Push $0
FunctionEnd


try this

Originally posted by Anders
this can't be the only registry entry it creates, does it create a normal uninstall entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\?
was the first thing i looked for, i also searched the registry for 'adobe air'. when i checked using beta 1 there was no such entry, now that i upgraded to beta 2 there is one! so detecting the version remains a problem with beta 1 users, but the script above should work for those.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe AIR

having said that.. good nite! :)

I solved this way...


Function "GetAIRVER"
!define AIRVer "1.0.5.53310" ; Version necesaria de AIR

GetDllVersion "$COMMONFILES\Adobe AIR\Versions\1.0.5\Adobe AIR.dll" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
; StrCmp $R2 "0" +3 0
StrCpy $1 "$R2.$R3.$R4.$R5"

StrCmp $1 ${AIRVer} verCorrecta verIncorrecta

verIncorrecta:
MessageBox MB_YESNO|MB_ICONQUESTION "Es nesesario instalar archivos adicionales. $\r$\nSi desea continuar ahora, presione el boton Si$\r$\ny luego haga click en el boton que dice I Agree." IDYES Instalar
Abort

Instalar:
ExecWait "dependencias\air_b2_win_100107.exe"

verCorrecta:

FunctionEnd


you should consider that your script will not work with future versions of air


Hello....
Yes that is right, i have cosidered to make a logic structure for comparing each number, but i have to finish the installer.

So i will try to implement it in the future.

Thanks a lot.