Hi,
I hope someone is going to be able to offer some advice on this issue as I
seem to have hit a dead stop!
I am new to WiX, so hopefully I am not missing any fundamental steps here. I
am creating an installer for a web service. This web service needs to go
through all of the testing phases, and then into a live environment. Because
of the different environments the application will be used in, a new
dialogue window was added to the UI to capture the environment specific
information whilst installing. This information is stored into the registry
at the time of install like so:
<Component Id="WriteRegKeys" Guid="2BF7E3E3-D255-4b1f-BB5D-A69D652F4FE7">
<RegistryValue Id="REGINSTALLDIR" Root="HKLM" Key="Software\test\testapp"
Name="InstallDir" Action="write" Type="string" Value="[INSTALLDIR]" />
<RegistryValue Id="REGLOGSINSTALLDIR" Root="HKLM"
Key="Software\test\testapp" Name="TraceLogsInstallDir" Action="write"
Type="string" Value="[INSTALLDIR]TraceLogs\" />
<RegistryValue Id="REGSERVERIP" Root="HKLM" Key="Software\test\testapp"
Name="ServerIP" Action="write" Type="string" Value="[SERVER_IP]" />
<RegistryValue Id="REGSERVERPORT" Root="HKLM" Key="Software\test\testapp"
Name="ServerPort" Action="write" Type="string" Value="[SERVER_PORT]" />
<RegistryValue Id="REGWEBSITELOC" Root="HKLM" Key="Software\test\testapp"
Name="WebSiteLocation" Action="write" Type="string"
Value="[WEBSITE_LOCATION]" />
</Component>
All of this works fine. I can see all of this information being written to
the registry, and when viewing the website in IIS, everything has been set
up correctly.
Now for the problem, Uninstalling. When I try to uninstall the application
by running the MSI and selecting Remove, it reaches the status of
"Committing IIS Metabase Transaction", and then displays a msgbox informing
me that it "Failed to read IIsWebSite table (-2147023728 )". After
investigating for a while, it seems that this error appears to be happening
because of the none-default installation information of the website. If I
try to uninstall the application using the command line and passing it some
parameters like so:
C:\>msiexec.exe /x
Installer.msiINSTALLDIR="F:\Home\WebsiteHome\IIS\testapp"
WEBSITE_LOCATION="test Web
Site" SERVER_PORT="20200" SERVER_IP="*"
The application uninstalls fine. I read somewhere on someone's blog, that
creating a shortcut allows you to pass arguments, so I thought this might be
a good way of fixing my problem, as this would allow me to simulate the
command line version of the uninstall. So I created this:
<Directory Id="ProgramMenuFolder">
<Directory Id="ShortcutFolder" Name="Web Service">
<Component Id="UninstallShortcutComponent"
Guid="0AB3DEEB-81F0-460c-9206-94EF1AD583E5">
<RegistryKey Root="HKCU" Key="Software\test\Uninstall">
<RegistryValue Value="test Uninstaller" Type="string" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="UninstallProduct" Name="Uninstall test"
Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]
INSTALLDIR=[REGINSTALLDIR] WEBSITE_LOCATION=[REGWEBSITELOC]
SERVER_PORT=[REGSERVERPORT] SERVER_IP=[REGSERVERIP]"
Directory="ShortcutFolder" Description="Uninstall JWEmail" />
<RemoveFolder Id="RemoveShorcutFolder" On="uninstall" />
</Component>
</Directory>
</Directory>
However, this fails with "Failed to read IIsWebSite table. (-2147024883)". I
believe the answer to this issue now is that when the application comes to
uninstall, it does not know what the constants [REGINSTALLDIR]
[REGWEBSITELOC] [REGSERVERPORT] [REGSERVERIP] are, as these were created at
install time and written to the registry.
So my question is then, how, at uninstall time, can I read the registry and
re-populate these constants with the values from the registry? Is this even
the right way of doing this?
Sorry about the long winded explanation, but I thought it better to try and
explain the situation as best as I could before creating the post.
Any help / advice on this would be great!!
Cheers
Bob
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users