Hi Francesco,
I can recreate the problem in the sample IIS project.
The get IIS Index returns 0 if the site name comes from a listbox rather than a combobox.
Here's what I did:
openend the
Code: Select all
~InstallAware Clipboard Data~
~Comment~
~{BFA8C996-3643-4703-A87A-A11A957EEEEB}~
~Creating IIS Websites and Virtual Folders Example~
Edit the "Wizard" dialog
Add a listbox, populate from $SITELIST$, write to variable WS2
declare variable WS2 same place as WEBSITE is declared
Code: Select all
~InstallAware Clipboard Data~
~Set Variable~
~{067BC46C-3844-4466-97A8-AAC114C14234}~
~WS2$MYAH$MYAH$TRUE~
~~
~Set Variable~
~{C5451F22-8E4F-4700-80C5-6A6E631B1932}~
~WEBSITE$MYAH$MYAH$TRUE~
~~
~Comment~
~{54A2CE54-0B67-45DF-B457-F3A565C6F0A5}~
~On first-time run, define these variables as persistent - so setup remembers their values upon restart for maintenance or repair operations~
Create watch for WS2 and WEBSITE
Copy line where website name is resolved to IDX
Code: Select all
~InstallAware Clipboard Data~
~Get IIS Site Index~
~{970999A8-6B13-45D0-A823-6DF30451D757}~
~$WS2$~
~WIX~
~Get IIS Site Index~
~{4F2974F0-7182-4107-BF43-E4D7DDF236E3}~
~$WEBSITE$~
~WEBSITEINDEXVAR~
create debug build and debug.
Value of WS2 is "Def12"
Value of WEBSITE is "Def12"
(according to watch list)
Get IIS Index for Site "$WEBSITE$" into WEBSITEINDEXVAR
-returns 2
Get IIS Index for Site "$WS2$" into WIX
-returns 0
Now, I know that I can just use a combobox instead of a list box, but why?
Best regards
Bo