You shouldn't prompt from the execute sequence. There are ways of "running"
MSI files where there is no user session to respond to the prompt and you
would hang your install.

The best way to show a message box from a custom action (and the only
supported way if you must do so from the execute sequence) is using the
MsiProcessMessage API (or something that wraps it, like WcaProcessMessage or
Microsoft.Deployment.WindowsInstaller.Session.Message).

-----Original Message-----
From: Lukas Haase [mailto:lukasha...@gmx.at] 
Sent: Thursday, July 22, 2010 12:47 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Upgrading from other setup program to WiX/MSI

Dear Blair,

Am 22.07.2010 01:04, schrieb Blair:
> 1. You can build MSIs with WiX that don't require running the setup as
> administrator. Nothing that can be done outside of Windows Installer
without
> elevation requires elevation in Windows Installer to also do.

In fact this is exactly what I do NOT want: I need to register a COM 
component which requires admin privileges.

So I have

<Property Id="ALLUSERS">1</Property>

and

<Condition Message="...">
   Privileged
</Condition>

and I am lucky. In fact this is exactly what messed up my previous 
installations with SetupSpecialist: The old "viewer" did not need 
registering a COM, so some users installed as admins and systemwide, 
others not.

Finally, SetupSpecialist lets you run the setup as normal user and when 
registering the COM the there is an error. The setup terminates and the 
a half installed system is left.

In my opinion it is the best and consistent way to install the software 
just into the system (incl. Shortcuts for all users)

> 2. Windows Installer has no built-in support for detecting/removing
non-MSI
> packages. However, if you know how to find/remove your SetupSpecialist
> package (the Uninstall key, perhaps?) then you can detect presence and
> automate removal as part of your upgrade (does the old installer allow
> "silent" removal?) You may have trouble detecting/removing things
installed
> by other than the current user, however, but that is due to the nature of
> how Windows treats user accounts/profiles, not do to any inherent
limitation
> in Windows Installer itself.

Thank you for the hint. This is what I have done now. As written in a 
new post ("InstallExecuteSequence completely ignored") I face heavy 
problems concerning this right now.

However, my approach is:

<CustomAction Id='CheckingSpecialist' BinaryKey='CheckingSpecialist'
   DllEntry='CheckSpecialist' />
<CustomAction Id='RefuseInstall' Error='You must uninstall the old one 
first' />

<InstallExecuteSequence>
   <Custom Action='CheckingSpecialist' After='LaunchConditions' />
   <Custom Action='RefuseInstall' After='CheckingSpecialist'>ABORT = 
"1"</Custom>
</InstallExecuteSequence>

<Binary Id='CheckingSpecialist'
   SourceFile='CheckSpecialist/Release/CheckSpecialist.dll' />

The DLL just opens the registry key in Uninstall and reads out the path 
to the uninstall program.

Then it asks: "You must remove the old first, do you want to?". If the 
users answers with no, then ABORT = 1 is set.

Otherwise, the process uninstall is started with ShellExecuteEx and 
waited for termination with WaitForSingleObject. Afterwards ABORT = 0 is 
set.

If it fails to open the key (i.e. no old version found) just ABORT = 0 
is set.

Is this a good idea or did I break some best practices?

Regards,
   Luke



----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to