Force shutdown in MSI installer? - wix

I'm working on a hardware driver installer/updater. Part of the installer/updater installs an updated FPGA firmware. A requirement of the card when upgrading the FPGA firmware is that the machine must be fully powered down for the firmware upgrade to take effect. I have found the schedule and force reboot properties for MSI installers, but haven't found an analogue to force or schedule a shutdown. Is there anything in msi/windows-installer/WiX to do this, or can anyone suggest a way of accomplishing this?

You could use the QuietExecute CA to call shutdown or write your own CA. Also be sure to set the /f for force option. Otherwise, be really careful that you give users the ability to supress this shutdown. Another thought might be to have your application tell the user that the software won't work until the hardware has been cold started instead of having the installer do it.

You could try running "Shutdown -s" to shut the machine down. Take a look at http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/shutdown.mspx?mfr=true

Related

Restart Manager behavior with Windows installer

With Windows installer 4.0 and Restart Manager, would it be safe to assume that "Restart Manager" would take care of shutting down applications and hence there is no need for any sort of custom actions to handle shutdown of processes holding files, meant to be updated?
Are there any exceptions where "Restart Manager" might not shut down applications? Of course, I understand that when a policy such as DisableAutomaticApplicationShutdown is enforced, Restart Manager is disabled.
Does the process to be shutdown have to satisfy some criteria to be able to be shutdown by Restart Manager? I am running my msi packages silently.
What do I infer if a msi package requests for a reboot, even if "Restart Manager" is enabled?
Restart Manager is primarily a better detection scheme (than previously) for detecting the files that are in use during an installation operation. For example, the old scheme detected only running apps with a top level Window (excluding tray apps). The only apps that get automatically closed down and restarted are those that have signed up to do that. Basically that means your app calls RegisterApplicationRestart() telling it what command line you wish to be restarted with. The app watches for WM_QUERYENDSESSION messages that tell it that it's about to be shutdown, and it writes recovery info for its subsequent restart.
Example here:
http://www.advancedinstaller.com/user-guide/qa-vista-restart-manager.html
So some of your questions don't apply, but obviously the point is to prevent reboots, whether it's a silent install or not. If a silent install needs a reboot it will just do it, because silent really means silent, there's nobody to ask, and the install isn't complete until after the reboot.
When apps don't do this work people usually resort to things like WiX Util CloseApplication calls to shut them down.
Note that services that are marked as Stop at Install (or uninstall, as the case may be) do not result in files-in-use situations. The file-in-use detection mechanism ignores files that are in use by services that are marked to be stopped in the ServiceControl table. So services are generally fine, but if the service spawns off other processes then they can result in files-in-use situations.

g++ writing on memory and messing up with SSH process on BBB?

This is a crazy question and maybe it does not make sense at all, but I need some help here. I am developing an application in a BeagleBone Black (BBB) in C++ (compiling with g++). Just as a matter of information, BBB is an open-source hardware board (like Arduino or Raspberry Pi) which can be accessed through SSH (and only via SSH). I use opencv and zxing libraries. Everything was working fine until I started using zxing (Google's open source QR reader library). So when I started compiling my application including this library, it worked fine until I turn the BBB off. Once I turned it back on, I am not able to connect via SSH anymore. This is something really weird and I cannot think why would this happen.
Recently, I had a problem in my application related to the memory area where some variables are and those areas being overwritten (checking with gdb). So I started wondering that maybe the BBB do not handle memory properly and something related to the SSH process is being overwritten. I do not know how SSH processes are handled on a computer, so I do not know if this is some crazy idea. Can anyone think if it is possible that the compilation (or zxing) is related somehow with the SSH not working after that? Is that even possible?
BBB uses Angstrom distribution.
Your issue is more likely with the driver you have to talk to the BBB. Try uninstalling the drivers and see if that helps. I got to the point where my Mac would not talk to my BBB at all, even with fresh installs of HoRNDIS and the FTDI driver. Everything works really well if you connect via an Ubuntu machine.
Probably the Beaglebone storage got full when you compiled zxing, so in next boots sshd can't be started.

Run IntelliJ in client-server mode

Currently, IntelliJ IDEA does not have a "Remote Development" feature.
Lets say I have two machines: Machine 1 (very good configuration ex 64GB ram with Intel Xeon processors) and Machine 2 (Macbook Pro with 8GB RAM).
Lets say I have IntelliJ IDEA installed on both machines. The problem now is, there is no client-server mode for the IDE. The closes thing I have is to use OpenNX.
What I'm looking for is a plugin/feature that enable remote development. What I mean by this is: On my macbook, I should be able to add Machine 1 as a "server". And once that is done, the IntelliJ IDEA on my macbook will only act as a client for the IntelliJ IDEA on my Linux box. Basically it would be replicating the UI. However, the catch here is that, it shouldn't do so by sending images (the way any VNC or NX client would). Instead, since it is for a specific application most of the data can be managed through text data only.
Since OpenNX uses images, even with compression it wouldn't match up the performance of text only transmission.
Basically I'm looking for IDEA on one machine to be a client (Remote GUI) for IDEA on another machine.
UPDATE
The eventual answer is: This is not possible (As of now). While I was aware of other options, that wasn't what I really wanted. However, it appears there is no such option.
The main reason why I wanted the option was because my desktop (remote Linux box) has a much higher configuration (Intel Xeon 2GHz processor and 64GB RAM) and my client was an Macbook Pro with Intel Core i7 and 8GB RAM. (By no means any less). However, due to the size of my codebase etc, the indexing of the code etc by the IDE slows it down.
Both client and server are perfectly capable of running an IDE by themselves. However, due the size of the code base it would be better to have the build of the work being done by the IDE on the server and the client being just the front end to it.
The other solutions like VNC, Nomachine - OpenNx all use image compression. And when your client is a Mac, you run into keyboard mapping problems. A client-server mode in the IDE itself would use text compression instead and would be much faster. It would also solve the keyboard mapping problems.
While to me, it sounds like a good idea, it probably doesn't get used by enough people for it to be a feature of the IDE.
Note: I would also be open to considering Eclipse as the IDE if this feature is available. Any answers will always be apreciated.
You'd probably be better off switching instead to a remote code repository that you keep in sync. While the concept of doing this in an IDE plugin is interesting, it has some fundamental flaws. What happens when the machines can't talk to each other? Are you unable to work at that point, or can you work offline. If you work offline on both machines, how do you reconcile changes...
I suggest looking into using "git". You can set up a remote repository very easily. If you have ssh access to either machine or some other shared machine, you can create a remote repository on that machine, and your "client" machines can easily push files/changes around.
There are plenty of other code repository options, but I've found git the easiest to set up.

how to notify user when glassfish is down

I am using Glassfish v3.0.1 for my project. However, Glassfish seems to be down many times. Therefore, I want to develop a mechanism that notifies me whenever Glassfish is down. Is there any option in Glassfish? If not, how can I achieve this? Further, how can I understand why Glassfish goes down? I cannot find proper explanations in logs.
I'm not aware of any options in Glassfish itself and I doubt there are any (it's usually hard for a process to know when it's dead :-). Write a script that tries to connect to the service (for example, using wget or curl) or use a system monitoring tool that watches processes.
To find out why Glassfish terminates, you must debug the problem. Here are some tipps:
Add/enable more logging
Search the source code for System.exit(). This can terminate an Java app without any trace of why it happens. (this might help, too)
Check the standard output of the process
Look for crash dumps; see the documentation of the Java VM which you're using.

How to simulate that someone is "watching" the monitor?

I am automating web-application tests that are driven by Selenium architecture in Windows VMs, connecting via Windows Remote Desktop. It became known to me that Flash/SWF and other in-browser elements behave differently if the VM window is opened/shown (all is cool) and when the window is closed (or maybe even minimized). Which means that browsers/plugins engage some optimization if no one watches the screen (I might be wrong with that - if so - please correct me).
As a (working) workaround, installing VNC (and logging into it at least once before running the tests) helps. From that moment noone needs to "watch" the monitor.
I think that the same functionality/system calls is used by (for example) movie players that cancel the screensaver during the film watching.
The question is if any special daemon was written for those purposes, so I won't need to connect to those machines by VNC, but only to run the daemon.
Update: http://www.jddesign.co.uk/products/freeware/freeware_programs.htm - meanwhile found this utility, checking if it will do the job. Advices are still welcomed.
Update N2: the utility above doesn't do the job.
What you experience is the standard render optimization: The OS will ignore all rendering commands if the window isn't visible.
My guess is that VM tools "minimize" the whole desktop to save memory as long as no one is connected.
On Unix, I'd write a small script which runs the VNC viewer when the tests are started.
[EDIT] What you're looking for is a kind of /dev/null device for VNC connections.
Here is a solution that might work: Download the sources for the TightVNC Java Viewer (license: GPL) and remove all the rendering code.
That should allow you to start a headless VNC client for your tests.