Serious "Installer" class bug (?)

  • Thread starter Thread starter John L.
  • Start date Start date
J

John L.

Hi there,

I created an MSI deployment project and am using the
"System.Configuration.Install.Installer" class to implement some custom
actions at install time. In "Installer.Install()", I save some info in the
".InstallState" file which is routine for those familiar with this class.
However, when I try to launch my app via the Start menu as a
non-administrator (after installing the app as an administrator for all
users), MSI tries to invoke my custom actions again (why?) and somewhere in
the plumbing of all this, something is trying to *write* to the
".InstallState" file before my app starts. The ".InstallState" file is under
"Program Files" however so MSI fails with an access rights error. Has anyone
seen this behaviour before. It looks like something is seriously broken in
the logic behind this class. Thanks.
 
This is normal behavior when a repair kicks in. If you did something like
remove files or folders then a repair will kick in to restore files or
registry entries. This repair is at the installer component level, so the
installer component is re-installed. Visual Studio custom actions are
typically conditioned internally on installation of the component, so your
custom action is called again. Having a condition of Not Installed on the
install custom action stops it being called again on a repair. Installed is
a case-sensitive property.
 
Adding what I added in the MSDN ClickOnce/Setup forum reply:

In this case the repair is because it's running as a different user and
something appears to be missing, probably a user-specific item that's being
installed, a file or registry entry.

--
Phil Wilson
[MVP Windows Installer]

Phil Wilson said:
This is normal behavior when a repair kicks in. If you did something like
remove files or folders then a repair will kick in to restore files or
registry entries. This repair is at the installer component level, so the
installer component is re-installed. Visual Studio custom actions are
typically conditioned internally on installation of the component, so your
custom action is called again. Having a condition of Not Installed on the
install custom action stops it being called again on a repair. Installed
is a case-sensitive property.
--
Phil Wilson
[MVP Windows Installer]

John L. said:
Hi there,

I created an MSI deployment project and am using the
"System.Configuration.Install.Installer" class to implement some custom
actions at install time. In "Installer.Install()", I save some info in
the ".InstallState" file which is routine for those familiar with this
class. However, when I try to launch my app via the Start menu as a
non-administrator (after installing the app as an administrator for all
users), MSI tries to invoke my custom actions again (why?) and somewhere
in the plumbing of all this, something is trying to *write* to the
".InstallState" file before my app starts. The ".InstallState" file is
under "Program Files" however so MSI fails with an access rights error.
Has anyone seen this behaviour before. It looks like something is
seriously broken in the logic behind this class. Thanks.
 
Adding what I added in the MSDN ClickOnce/Setup forum reply:
In this case the repair is because it's running as a different user and
something appears to be missing, probably a user-specific item that's
being installed, a file or registry entry.

Thanks (note that I'm now logged onto my own account again). See my reply in
the forum under the title "Is this a bug? Can't acccess ".InstallState" file
as non-admininstrator" (for others reading this).
 
Back
Top