Pasting in MSI Installer TextBoxs - installation

We are upgrading our installers to MSI, and have noticed that you can not "right click and paste" into the text boxes. You can however ctrl+v. Is there a setting that you can switch on to enable context menus within the installer?

The MSI native UI is horribly primitive, though pretty clever considering it's expressed using a set of database tables ;)
If you need to exercise any degree of control over the UI then you would be better off writing your own front-end interview applet to build up a set of configuration parameters and using that to launch the install with a minimal UI, passing the the parameters in as a set of installer properties.

MSI subclasses the controls it displays, the WndProc for edit controls which MSI sets for edit controls may be implemented in a way that it does not pass right-click events to the original WndProc, and therefore context menu is not displayed.
There's no setting that you can enable context menu functionality.

Related

How can I add an optional UI to WiX toolset

I have already made a quiet installer (without the need to click any buttons but some progress bar is shown while installation is in progress) for a project deployment. This time I wish to add an optional graphical user interface.
By default, the installer should just run without clicking anything, when a parameter is given, let's say, the msiexec parameter: /qf, the installer would pop up an interface that can be interacted with.
I've already added the required UI dll to the project reference, but given msiexec /i C:\Setup.msi /qf, it doesn't work. How can I get it to work?
Did you try the procedure described in this well known Wix tutorial?
At its simplest level, this means that you essentially just add this to the Wix source file and you get a default GUI:
<UIRef Id="WixUI_Minimal" />
You can also try the other "defaults":
WixUI_Mondo (normal)
WixUI_FeatureTree
WixUI_InstallDir
WixUI_Advanced
A search turned up a similar answer, and one talking about extending the default gui.
Just modify the WixUI_Minimal.wxs file:
How to build a minimal WiX installer UI without a license page?
WiX toolset WixUI_Minimal Dialog Set
Customised UI's for WiX
Then use properties to condition the dialogs to show or hide as you launch the MSI via msiexec.exe.

How do I add a window from the resources as a child window?

I am creating a windows using win32:
HWND mainWnd = CreateWindow(...);
Now I can add gui elements as children of mainWnd. However this soon becomes a bit tedious and I want to use the designer built into Visual Studio to help me.
I noticed that under Add Resource there is a Dialog entry. Among the dialogs IDD_FORMVIEW seems the most general so I added one of these. Next I added gui elements to it using the designer.
Now I want to use this as a child of my mainWnd. How do I do this?
I found some examples using DialogBox, but I do not want a separate dialog, I want this window as a child of my mainWnd.
The designer in Visual Studio is appropriate for creating dialog boxes, not arbitrary windows.
That being said, there are a couple of approaches (in increasing order of difficulty):
Make your main window a dialog. Petzold's book has an example of using a dialog as the main window of the program. (If I recall correctly, it's the calculator example.)
Create the dialog and, before you show it, change its style to WS_CHILD, change its extended style to WS_EX_CONTROLPARENT, and parent it to your main window. For all the navigation stuff to work, you'll have to add IsDialogMessage calls in your message pump. This is do-able, but it's likely hard to get everything working well.
A mixture of 1 and 2 where you create one dialog for your main window, then create a second dialog for the content (with DS_CONTROL), and put the second dialog in the first. I've never tried this approach myself, but it seems like it should work.
Write your own code to parse the dialog resource and create the child windows, which is basically re-doing a lot of the work that CreateDialog does for you.
Given your desire to use the GUI to design the UI, I suspect only the first solution is simple enough that you would be interested.
Use the CreateDialog API to create the window from the resource. If you do not want it to look like a dialog then remove the titlebar style from the resource properties.
To use a dialog created from a dialog resource template you have to specify the DS_CONTROL window style in the template.
Read more about dialog boxes here.
Dialog resources are explained here

VS2010: How to see GUI

I need to know how to open the form of a program I am debugging.
I loaded an existing solution into VS2010, I can see the code, but I want to see the GUI part of the project, click on buttons and see what part of the code they take me to, set breakpoints where I feel like.
I don't know how to see the GUI in VS2010, where can I do that?
Also, where would be a good resource to learn the ins and outs of VS2010?
Depending on how the UI was created, there may or may not be a way to see the UI at design time. Particularly if this is an older Windows UI application, it's likely that the windows are created entirely in code, and there is no design-time UI for you to see.
There is a dialog editor, for dialog windows that are defined in resource (*.rc) files. CTRL-SHIFT-E brings up the Resource Viewer and you can look for things under the Dialog node. It is possible that your main window is a dialog-style window, as that's one of the options you get when you create a new MFC-based application.
Otherwise, your only option to see what your UI looks like is to run the program and see. Tracking down which UI elements do which actions in your program will require finding the appropriate event handlers or message handler methods (again, depending on what UI framework, if any, is in use) and setting breakpoints.
The generic answer is:
Hit F5 to starting Debugging mode. (Or under the Debug menu choose Start Debugging)
But it depends on how your project is setup and what type of project it is if F5 will work that easily for you.
What kind of program/language are you using?
With a form, I believe you have to File-->Open-->Project/Solution
Now if its a website, you would open Website. If you tried to open a windows form under a website then you wont see the design.
Typically you would just double click your form name (form1.cs) because then your design view will pop up or hit Shift+F7 or rightclick --> view designer. Then just double click whatever tools you have on your form (like a button) and it will automatically go to the button code.
If its a website, then it would be under website1.aspx while the code sits in website1.aspx.cs
But if none of that helps, here is a good place to learn this stuff
VisualStudioWalkthroughs

How to stop WiXUI flickering

I've been playing around WiX lately, and I have found that WiXUI wizard is not flicker-free. When you click "Next" to advance to the next step in the wizard, the wizard window is actually destroyed and then a new window is created with the next step. This does not allow for clean transition between "wizard pages". I come from Inno Setup, where this is perfect, no flickering or window recreation at all.
Is it possible to achieve flicker-free wizard steps transition in WiX, and how?
Is it possible to create my own wizard GUI (in C++ or Delphi), which would WiX use instead of the WiXUI?
That's how MSI handles the NewDialog control event. If you want complete control over UI, you need an external UI handler, like Burn in WiX v3.6.

Creating a Windows GUI .exe application

I have a C/C++ algorithm that I want to create a GUI application for. I would prefer a .exe application that I can pass around to people. I would preferably want to create a dll of my c/c++ algorithm and then bundle it into the Windows GUI application which is basically just a wrapper around the main c/c++ application. How can I create this GUI in VC++ all with a couple of buttons, a text box and a file chooser/browser/opener?
Can someone throw some light on this problem?
Thanks,
Abhishek
There's a number of different options. First we have the microsoft-supported libraries:
MFC - The most heavy-weight library for the windows api.
ATL - A somewhat smaller, lightweight library.
Windows API - Use the Windows API directly.
Beyond that there's a number of third party GUI toolkits, notably:
GTK+
WxWidgets
If you want to make it as small as compact as possible and avoid external DLLs, you should use the Windows API directly or possibly ATL. This also gives you additional flexibility, but it's a bit more complicated. Take a look at for example theForger's tutorial. It's a bit old, but the api has remained more or less the same for the last ten years anyway.
Here's some additional pointers for using the API directly:
What is usually known as controls is called "windows" and are created using CreateWindowEx(). This function creates different things depending on the specified "window class", such as edit, button and static (described below). You create a regular window by registering a custom class.
You can use a function called GetOpenFileName() to invoke an open dialog.
The common text box is known as the edit control in the API.
Buttons are simply called button controls.
Labels are called static controls.
If it's enough for your purposes, you can also create a dialog window using CreateDialog(). This is possibly a bit easier, since dialogs can be designed using the resource editor, while you have to create all the controls in a regular window programmatically.
In Visual Studio:
File -> New Project
In the left panel choose "Visual C++" (or C# if you prefer) and in the right panel choose Windows Forms Application. Click Ok.
When your project is created, in the Toolbox panel you can find Button, Edit Box, OpenFileDialogs and SaveFileDialogs (which you need). If you can't find Toolbox panel, you can enable it in View->Toolbox menu.
Place the controls you need on the program window as you wish by simply dragging them over.

Resources