hi!
i want to search for reg key A und reg key B. when the one of these keys is found it should be the install dir.
i tried it with
InstallDirRegKey ...
InstallDirRegKey ...
but it don't work
...
2 Reg Keys, 1 Install Dir
9 posts
Do something like this:
-Hendri.function .onInit
ReadRegStr $0 [RegAddress_A]
StrCmp $0 "" 0 Found
ReadRegStr $0 [RegAddress_B]
StrCmp $0 "" NotFound
Found:
StrCpy $INSTDIR $0
...
NotFound:
...
functionend
mh
it doesn't work 🙁
perhaps an example would help ...
- christoph
it doesn't work 🙁
perhaps an example would help ...
- christoph
What error does it give you?
I'ld have written ...
function .onInit
ReadRegStr $0 [RegAddress_A]
ReadRegStr $1 [RegAddress_B]
StrCpy $0 $1
NotFound:
...
functionend
function .onInit
ReadRegStr $0 [RegAddress_A]
ReadRegStr $1 [RegAddress_B]
; if $0 and $1 are null -> goto notfound else continueStrCmp $0 $1 NotFound 0
; (we dunno which one is the right one)StrCmp $0 "" 0 Continue
; so if $0 is empty, copy $1 (which is not) into $0
StrCpy $0 $1
; now $0 has got the right path...
NotFound:
...
functionend
.. sorry, i forgot a label 😁 !
StrCmp $0 "" 0 Continue
StrCpy $0 $1
Continue:
😉
StrCmp $0 "" 0 Continue
StrCpy $0 $1
Continue:
😉
veekee, my code works fine.
weidhas, an example? The code supplied already was an example. But ok.
weidhas, an example? The code supplied already was an example. But ok.
-Hendri.outfile 2regs.exe
name 2regs
function .onInit
; Make sure we have a regentry
WriteRegStr HKLM "Software\2regs" "dir" "c:\My docs"
; Now check the regentries as if
; we don't know the info above
ReadRegStr $0 HKLM "Software\skjgllfsg" "dir"
StrCmp $0 "" 0 Found
ReadRegStr $0 HKLM "Software\2regs" "dir"
StrCmp $0 "" NotFound
Found:
StrCpy $INSTDIR $0 ; So $INSTDIR contains install dir
MessageBox MB_OK $INSTDIR
Goto Continue
NotFound:
MessageBox MB_OK "No regsettings found!"
Continue:
functionend
section
DeleteRegKey HKLM "Software\2regs"
sectionend
Apologizes
Sure, your code works 👍 ! I didn't understood the first time i read it ! I beg your pardon, dear Smile2Me.... 🙁
Bad veekee, bad !
Sure, your code works 👍 ! I didn't understood the first time i read it ! I beg your pardon, dear Smile2Me.... 🙁
Bad veekee, bad !
Veekee, it's OK.
-Hendri.
-Hendri.