stop installation if detect process is running - process

I want to check if a process is running before installing a new add-in using the advance installer. To make that, in custom Actions, I select detect process and put the process that I want to stop. With that I get AI_PROCESS_STATE Running or Stopped. But now I don't know what to do to stop the installation if it is Running or at least show a message telling that is necessary to close it before continue.
There are options like display message box but if I put them they always appear. I don't know how to make them appear only when AI_PROCESS_STATE has the value Running.

There are several problems here:
The general way to do this is to call a custom action Dll that looks for the process, and sets an installer property if the process is running, then you can fail the install with a type 19 custom action and your own error message. Running a process doesn't give you a good way to return a value into the install so you can show an error message.
However, getting the list of processes requires elevation, and by default you're not elevated at the start of the install.
Are you sure you're not inventing a problem? Why should the user shut down the process? The user-friendly approach is to register your add-in and tell the user they may need to restart the app before their new add-in will show up.

Related

How to resolve error 0xc0000139

I'm developing a program on Widows10 with Qt. If I run it from the command line, it exits silently, immediately. When I try to debug it, a dialog box is displayed saying "During startup program exited with code 0xc0000139."
I know this means that Windows failed to load one or more DLLs.
How do I find which DLLs they were?
Ideally, I would prefer not to download any additional utilities beyond what is provided by Windows10 and Qt.
For what it's worth I resolved my problem.
It turned out the the program I was trying to run hadn't been rebuild since my last set of changes. I'm unsure why that was so, clearly my own error but I'm not sure what, precisely.
For the benefit of anyone coming here trying to find an answer to the question at the top of the page, if you have cygwin or another Unix-alike on your system, ldd is a good program with which to start looking through the sharable images you link to.

WiX Toolset - Handling the case of running the installer again after it's been installed

I have a custom bootstrapper (C# WPF) and it works well enough. If the installer gets run from the command line after it was installed, it brings up a window allowing the user to select if they want to modify, repair or uninstall. So far so good. Modify mode starts the UI which ends up calling Bootstrapper.Plan(LaunchAction.Modify). The problem is that if I call it from the launcher UI it immediately complains that a prior install requires a reboot.
I have not found any good examples on what this should do. Even the WiX mailing list came up blank.
Any ideas?
It would be helpful with the screenshot for that reboot message - just to get a feel for where it might be coming from and to get a literal string to search for. Did you have a look in the WiX source code yourself btw? (WiX 3.111 branch)
I started writing a lot of stuff about reboots. Not good. Maybe just some questions instead:
Does this happen every time you invoke modify and is it reproducible on more than one computer? Or maybe it is just Windows Update acting up on a problem computer?
I assume you have rebooted the computer where you see the problem and you see the problem again when you re-launch the bundle?
Do you schedule any reboots inside your MSI files during the initial installation?
Either using the ScheduleReboot action or a custom action which schedules a reboot with a call to MsiSetMode (for example)?
There is a long explanation here why such reboot-constructs cause problems, but that may be besides the point. Essentially badly configured reboot-constructs can trigger spontaneous, unexpected reboots without warning when packages are run in silent mode (plus other problems).
Could you try to run the test VBScript found in this answer: WiX behaving badly on XP machine with windows update issues in order to check if the script reports a reboot being necessary?
Other than that I guess you could try to run Burn yourself in debug mode (not sure how much plumbing that would be to get running) or perhaps first try a ProcMon.exe session to see if you can see something obvious. The latter should be quick to do?
There are some registry locations you can hunt down to see if you can figure out what triggered the reboot warning. Get-PendingReboot-Query. And a similar PowerShell script.
So in the end it was user error. :-( O well. I did learn a lot about how to figure out how Windows checks for the need to reboot etc.
The issue was simple in the end. During the modify run it was uninstalling, then reinstalling a number of services. The problem is that when it runs (seeing as you have to set it to repair to get it to work) it copies all the files again and the services were still running at the start of the install. The fix was to uninstall anything that might lock a file before the actual file copy starts and that solved the issue for me.
Thanks for your help guys, all the info helped me look in different directions until I found the issue. Awesome community as always!

error occurs when vb.net application is published

How can I solve this error when the application is published:
You probably have just installed it, but you've done it running the setup from a different location.
Uninstall the application and run again the setup. Remember to run the setup from the same location when you update it.
I'm not 100% sure about it, but form my experience it's correct.

Is it possible to show errors in silent install in windows

I have a created an installer using WiXStandardBootstrapperApplication. The intention is to run it silently and I do that using the /quiet flag and it runs silently just fine. The way it runs is, as soon as I enter the command on the command prompt the control returns to the command prompt instantly and the installation happens at the background. So if there are any errors or even in the case of Success, I don't know whether it completed fine or for what reason it failed. In linux, I can run a command silently and the console will show the progress of what are the things that it is doing. Can I do something similar in Windows? I initiate the command and the logs are displayed on the console or at the very least a Success or Failure message is shown on the console window before it stops the execution.
I am aware about the messages being logged in the log file but wanted something to come on the console itself. Thanks for your help in advance.
The point of /quiet switch is to have a silent installer. That contradicts the requirement to show any UI. If the installer encounters any errors, it will return exit code other then 0. Details about the failure are in setup logs.
WiX does not do any console logging.

Adding software setup to installer

I'm writing an installer for an application. Most of the installer is done and working, but I have on more step outstanding. I need some way to add a setup window to the installer, that will take user input like server address and port, etc. and write these to the relevant files for system start-up. This preferably done through a GUI of sorts inside the installer.
I've tried creating an executable file that runs after installation, but this does not always execute on different systems.
Is there a way to add a GUI to the installer itself that executes after the directory structures and files have been put into place?
Thanks in advance.
In general you should seriously consider doing this as a standalone app that runs when the app first runs and needs configuring. Then it's a program that runs in a user context and can be tested and debugged in the normal way. At least consider what the user is going to do if they want to change the server address or the port - will they need to uninstall your app and reinstall it just to change the server details or the port?
The GUI may not run correctly when started from the install for a number of reasons. It may be initiated with the system account if it's a deferred CA. It wasn't started from the interactive user shell, so it probably won't have any idea of a working directory. It's being run from an msiexec.exe process running in the system directory and maybe with a system account - that's not really the place to be doing your GUI configuration.
I assume you're using WiX, it doesn't say so in your question but it's tagged with WiX.
I would have a read of http://wix.tramontana.co.hu/tutorial/user-interface-revisited (or http://www.dizzymonkeydesign.com/blog/misc/adding-and-customizing-dlgs-in-wix-3/ has a relatively easy to read example), you can add or edit any of the dialogue boxes in the installer, you'll need to download the source to get at the built in dialog, and it does require some "play" to get everything quite right but worth it to get a professional looking installer.