While Loop not working as expected...
Hi,
I've been working with NSIS for quite some time now and rarely ran into an issue which left me totally clueless. In fact this forum and the documentation solved pretty much all questions so far.
With this one though I am out of ideas. All the variables are defined in an external NSH file which is being included, that worked like a charm so far.
My input variables are...
!define PRODUCT_TYPE "ABC"
!define DISTRIB_WEBSITES_ABC "3"
!define DISTRIB_WEBSITE1_TXT_ABC "Website Title 1"
!define DISTRIB_WEBSITE1_URL_ABC "http://www.example1.com"
!define DISTRIB_WEBSITE2_TXT_ABC "Website Title 2"
!define DISTRIB_WEBSITE2_URL_ABC "http://www.example2.com"
!define DISTRIB_WEBSITE3_TXT_ABC "Website Title 3"
!define DISTRIB_WEBSITE3_URL_ABC "http://www.example3.com"
The PRODUCT_TYPE defined varies depending on which installer I want to compile, the remaining variables are static - though the number of links varies hence the following while loop...
StrCpy $R1 "${DISTRIB_WEBSITES_${PRODUCT_TYPE}}"
${While} $R1 > 0
WriteIniStr "$SMPROGRAMS\${PRODUCT_NAME} ${PRODUCT_TYPE}\Links\${DISTRIB_WEBSITE$R1_TXT_${PRODUCT_TYPE}}.url" "InternetShortcut" "URL" "${DISTRIB_WEBSITE$R1_URL_${PRODUCT_TYPE}}"
IntOp $R1 $R1 - 1
${EndWhile}
...once I run this NSIS instead of creating the LNKs with the proper text/url comes up with literally my variable name as TXT and URL.
"${DISTRIB_WEBSITE1_TXT_ABC}.LNK" > "http://${DISTRIB_WEBSITE1_URL_ABC}"
"${DISTRIB_WEBSITE2_TXT_ABC}.LNK" > "http://${DISTRIB_WEBSITE2_URL_ABC}"
"${DISTRIB_WEBSITE3_TXT_ABC}.LNK" > "http://${DISTRIB_WEBSITE3_URL_ABC}"
Since the numbers are there I can assume that my loop works fine but why doesn't it put the proper details in as text/url? Do I have a general brain fart here and this an issue of the while loop working different between compile time and installation?
P.S.: To clarify, I am running NSIS 3.0a1 - worth testing the old versions?