Is there any way to display an warning message if the user tries to install my app when the battery level is under 5%? I'm using InstallShield.

- 39,960
- 25
- 91
- 164

- 4,652
- 15
- 48
- 57
-
+1 For being very thoughtful about your users... these days, that's very rare. – aviraldg Oct 20 '09 at 13:43
-
+1 nice idea. i love this suggestion. but now, InstallShield does not have this feature. – Raptor Oct 21 '09 at 03:57
-
Why would that be useful? I have working standby and hibernate both of which so far failed to disrupt any installation. – Joey Oct 21 '09 at 13:14
-
a warning would not be bad anyway – Cornel Oct 22 '09 at 06:35
-
Isn't this available? If not, I think it should qualify as something that should be a standard Windows Installer action. Perhaps we can ask the Wix guys to add it as a standard launch condition in Wix. – Stein Åsmul Sep 10 '14 at 10:50
3 Answers
Don't know if Installshield supports this directly, but you could create a autorun menu program that gets run first, that checks battery level, then if its ok, runs setup ?

- 1,512
- 1
- 24
- 47
There are several .NET-related answers in this SO question. At least the GetSystemPowerStatusEx function could be helpful for you.
What version, edition of InstallShield and project type are you using? The answer depends, but generally InstallShield can call Win32, COM and Managed API's so it is very doable with a little bit of coding.
I'd wonder if you really want to check at 5% though. Most installs I've seen simply check that you are on line power instead of battery when gating the install. 5% is already pretty low and might now give you much time to do whatever you need.

- 54,556
- 6
- 63
- 100