How to update the InnoSetup Wizard GUI status text from PascalScript code - installation

I execute a lot of custom actions in my InnoSetup script in the CurStepChanged(ssPostInstall) PascalScripting event handler. As these actions take some time to finish, I'd like to update the InnoSetup Wizard GUI status text and tell the user what is going on behind the scenes. Something similar that is possible in the [Run] section using the "StatusMsg" parameter. I know that I could use the TOutputProgressWizardPage/CreateOutputProgressPage(), and I did in a previous project, but it's a bit too much overkill to my liking...
Is there a simpler possibility to update the InnoSetup Wizard GUI status text from PascalScripting code with the same effect as the StatusMsg parameter?

Use this from your CurStepChanged handler:
WizardForm.StatusLabel.Caption := 'status update';

Related

FileOpenDialog from vbScript custom action appears behind main dialog

I'm creating an installer at work that must open a file browser. There is no file browser in wix, so I built a custom vbscript action that uses the Shell.BrowseForFolder method. It's working fine, but the file dialog shows up behind the main wix window. Does anyone know a wix/vbscript approach I could take to solve this problem?
Locate the HWND for the MSI UI and pass this into Shell.BrowseForFolder. I see a few example solutions that use FindWindow("MsiDialogCloseClass", vbNullString). Be careful about launching UI from a custom action: you need to consider silent installs/repair/uninstall, etc to make sure you get it right in all cases.
It looks like you're trying to allow the user to pick a directory. MSI has native support for this. I reccomend you use that. For an example see http://wix.codeplex.com/SourceControl/latest#src/ext/UIExtension/wixlib/BrowseDlg.wxs.

InstallShield add custom action to check for anti-virus

I am a bit of a beginner at InstallShield (in the sense that this is the first time I've used it!).
I have some code that I am packaging up in a .net DLL to check for the existence of anti-virus. The installer I am attempting to create must check for anti-virus (by calling a custom action using my DLL?) and cancel the install if none has been found.
The way I seen it working, was the user would see a dialog that is informational ("about to check for anti-virus"), the user would press "Next" it would call the custom action and then show a success screen with a "Next" button, or a failure screen with "Finish" button.
Is this sort of thing possible with InstallShield? Are there any good tutorials out there for doing this sort of thing?
Do you really need a custom action? Do you have more detailed requirements with regards to what products and versions you are looking for?
InstallShield / Windows Installer has a built in search pattern that can look for registry entries, files, et al.
If you really do need a custom action, how long do you expect the execution to take? If it's only a couple seconds, just schedule it to run after AppSearch. You don't need a UI to say "now doing blah" just do it.
Since you want to do this in .NET, you need to look at Windows Installer XML (WiX) Deployment Tools Foundation (DTF). You can use this to author/compile custom action DLL's that InstallShield can then consume. Generally the custom action should do it's search and then set a property based on it's result. Then use that property in evaluating whatever business rule you are trying to implement.

Check if application is not running

I am developing a WiX installer (I am very new to this) and want to implement a method (like launch condition) which check if a particular application is running or not. If it's running then a warning message will popup displaying close the application message. I want this check before the welcome screen.
How can I implement this? Some working example will really help me a lot.
Windows Installer already has a FilesInUse and RMFilesInUse (Restart Manager) support. Does this not meet your needs? With these patterns you'll get a dialog telling the user that they need to exit a program or risk needing a reboot.
This can be done only through a custom action. Here is a tutorial for a C++ DLL native custom action: http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL
Your custom action can perform the check and then show a message to the user if necessary. It
can return 0 to continue the installation or 1602 to stop.
To show the message before Welcome dialog, you can try scheduling your custom action right after CostFinalize action in InstallUISequence.

wix result from program execution?

Using Wix, I would like to run an executable (that is being installed) and capture the return value. I have no problem running the executable via:
<CustomAction Id="UpgradeDBFromExe" FileKey="UpgradeDB.exe" ExeCommand="/update" Execute="deferred" Impersonate="no" Return="ignore"/>
But i'm not sure how to capture the return value. If I change the return to 'check' then on failure the installer rolls back (not what I want to happen), instead I want to check this result later (presumable via a property) and display a warning. My thoughts are to use a CustomAction script to call the executable and store the result as a property but this seems messy. Is there any better way to do this?
I will assume that this CustomAction makes a change to the system and therefore requires privs and is therefire scheduled as deferred / no impersonation. Because of this, and the fact that it's an EXE custom action that's running out of process, MSI doesn't provide a way to set properties. If you use the WiX Quiet Execute Custom Action pattern you could capture the stdout and log it but that's about it. If you used a DLL custom action type you could check the UILevel property and optionally popup an MSI MessageBox asking the user if they want to continue and based on that you could return success or failure but as an EXE you are kind of stuck.
Another approach would be to have another custom action run in the UI Sequence after the execute action that validates what the EXE did and set a property for success/failure and then drive some UI off of that. My only concern there is it's too late to roll the install back and users tend to not read what you put in front of them anyways.

VB run code on start of the application

I am a Java programmer and don't know much about VB.
My task:
Create an exe. When I run the exe it will read a text file, and after that it will display the content. After that the application code ends.
What i have done:
I have created a project and created a button on the form. On click of the button I have given the option to read.
Problem
I am not able to find the event which has to be used to run code on start up and code to end the application when my task completes.
Please help me with the process which I have to follow. If the code is provided, it's best, but if somebody knows any web resources it will also be a great help.
You can create a Visual Basic 6 program to run without any form.
You need to create a module. Put a Public Sub Main inside of it.
Then in under Project Properties, General Tab; change the startup object to be Sub Main.
To do something at form's start up, use Form_Load() event.
To close a form, use unload me.
To close your application, use end.
Hope this solves your problem. If not, you are welcome for further queries.

Resources