I am looking for a way to use prompt ScheduleReboot action in WIX installer only in the condition there is more than one user logged in to the target machine. So far I couldn't find a condition or other built in way to do that, I decided to ask here before writing a custom action.
Thanks.
answers to @Stein Asmul qustions:
The app is a dev tool that could be deployed on any type of machine with any type of windows os newer than Windows xp. I need to restart on the case of more than one opened session since the app involves several user-owned processes that are being started during the installation and then on windows startup. When these processes are off for one user and on for another it could lead to an invalid state of the app, or at least to a state that we are not planning to support. Since I have no easy way to start these processes for a logged on user that is not the one who ran the installation, asking a restart is an acceptable solution for me.
I have no problem writing the code for a winform that checks the number of logged on users with a WMI query and based on the response offers to restart, even though it's always nice to use someone else's already written and tested code. I guess I could write a Wix CustomAction that saves a property indicating if the there is more than one interactive log-on and then use it as a condition for a ScheduleReboot, but like many things in Wix, it would be complicated, very hard to debug and the end result would be almost similar. I would, of course, prefer to get from somewhere a tested "Wix" way to do that since a simple winform limit my options to what I can do with Wix, but I haven't found anything and it's not something I'm going to get into right now.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…