I have some problems with the programm I'm writing.
(hope that are all the important bits)
Var WORD_DIR
Installdir "$WORD_DIR\${PROGRAM}${VERSION}"
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "Word.ini" "Wordverzeichnis"
Functionend
Function Wordverzeichnis
; Tries to find the newes Word- version
ReadRegStr $0 HKLM Software\Microsoft\Office\11.0\Word ""
ReadRegstr $1 HKLM Software\Microsoft\Office\10.0\Word ""
; etc... to be added when it even works
${If} $0 != ""
ReadRegStr $WORD_VERSION HKLM Software\Microsoft\Office\11.0\Word\InstallRoot "Path"
${ElseIf} $1 != ""
ReadRegStr $WORD_VERSION HKLM Software\Microsoft\Office\10.0\Word\InstallRoot "Path"
${EndIf}
!insertmacro MUI_INSTALLOPTIONS_WRITE "Word.ini" "Field 1" "State" $WORD_VERSION
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Wordverzeichnis"
ReadINIStr $WORD_DIR "Word.ini" "Field 1" "State"
FunctionEnd
Now, the problem is
a)
it doesn't read the word directory from the registry(cause I know I have Word 11 on the PC) or at least doesn't write it into the ini. It still states the defaut directory. Is the logical code wrong, or the registry stuff?
b)
it doesn't read the final directory. When I state a directory on the custompage, and go to the next page (normal directory page) it shows $WORD_DIR/Programmname. Did I use the variable wrong?
I'd be very grateful for any help. But please keep explanations simple, I'm pretty new to this. 🙂