How can I customize existing user interfaces in WIX - c#

I would like to add a custom user interface to my *.MSI created using Windows Installer XML. I am currently using the WIXUI_Advanced dialog set. I want to change the dialogs and remove some existing dialogs from it.
Can someone explain me the relationship between the dialogs and how to overwrite them with my custom code ? I have referred WIX documentation and ended up with a pile of errors while building the assembly.
Can someone explain me how these can be done with a working code example ?

Just download wix source code and use WIXUI_Advanced dialog wxs file as a template.
For example - Remove the InstallDirDlg in Publish elements and save it to your solution.
Check this link for example: http://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html

Related

Update app.config file after installer upgrade

I'm currently working on a Microsft Word Application-Level Add-in using C#. My application contains an app.config file. In this file I save user-settings (userSettings-Section) and some data defined by a custom ConfigurationSection. The data stored inside of custom ConfigurationSection is also user-specific.
I access the user-settings as follows:
Properties.Settings.Default.MyUserSetting
The custom ConfigurationSection I'm using like:
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal)
.GetSection("MyCustomConfigurationSection")
My questions are:
Do I even use the app.config the "correct" way? (I know that there is probably not only one correct way, but is "my way" one of these?)
Which ConfigurationUserLevel does Propeties.Settings.Default use? Is there a way of setting/changing it?
And Most importantly: Is there a way to automatically keep the user-specific settings during an upgrade of my application, but at the same time add newly created settings?
I deploy my Add-in using an installer built with WiX. At the moment I use CustomActions, which manually insert code for each added/removed/changed setting. But I was wondering whether there is a built-in way of doing this.
I did some researches the whole day now and I think I can answer my questions for myself:
Q: Which ConfigurationUserLevel does Propeties.Settings.Default use? Is there a way of setting/changing it?
A: It seems that Propeties.Settings.Default use ConfigurationUserLevel.PerUserRoamingAndLocal, what sounds logical as they only contain userSettings... I don't know whether it is possible to change it, but for me it is not necessary.
Q: Is there a way to automatically keep the user-specific settings during an upgrade of my application, but at the same time add newly created settings?
A: I found out that there is an Upgrade()-Method in Settings which should take care of copying user settings between an older version of the product and the new one. For more information see http://ngpixel.com/2011/05/05/c-keep-user-settings-between-versions/. I must confess that I haven't had occasion to test it, since I have no permissions to build the installer, but I will rely on it. I will come back to this post after I tested my solution.
Furthermore I am not using a custom ConfigurationSection any more. Instead I derive from System.Configuration.ApplicationSettingsBase, which means that I am able to handle the custom data exactly like the Properties.Settings, including the Upgrade()-Method. See this post for more information about how to use it.
Hope this helps somebody.

Create link from filesite matter folder to launch URL

I'm basically trying to create a link from a worksite folder in FileSite to take the user to our (Web based) CRM system or Case management system as shown below.
When the user right clicks the matter the option button (Goto CRM) will be available for then to click, I have created this in the following regkey
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Interwoven\Worksite\8.0\FileSite\Commands\Workspace] “Commands”.
Once the button Goto CRM is clicked, the matter numbers (all fields if possible) are used to compile the URL for the CRM webpage. e.g. http://Casemangesyatem/test9999.1.apx
I don’t know how this is achieved or what the file compiled is or how to create it, any examples notes would be greatly appreciated.
So how or what is used to compile the file that is location/called by the regkey
What do I use to create this file and how do I do it
Thanks you.
This is the only site that I have found with any reference to work-site sdk. I'm new to work-site sdk and would appreciate any kind of help with example code.
To run some custom code when a user selects your new right click option, you'll need to create a new DLL in Visual Studio to do the actions you need (e.g. redirecting the user to a custom website).
The worksite SDK contains some sample ICommands in VB.NET and C# to get you started. The main requirement for your custom code is that it implement the IManExtLib.ICommand interface like below:
Namespace MyCustomApp
Public Class IManageToInteraction
Implements IMANEXTLib.ICommand
...
In the registry key below the Commands value should contain the comma separated list of the ClassIDs of the ICommands you want to appear in the right click menus at that level.
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Interwoven\Worksite\8.0\FileSite\Commands\Workspace]
For example the following value includes some of the standard entries and our custom class from above and would appear in the right click menu of a workspace within Filesite.
IManExt2.AddShortcutsCmd,IManExt.SearchCmd,MyCustomApp.IManageToInteraction

What is 'TextFile' and where it is uses in WPF project

i want to know about the use of 'TextFile' item in wpf project-
1)I am Create a project in VS2010 .
2)write click on project(Or click on 'Project Tab in MenuBar')-->select 'Add New Item'--> in open dialog box,appear 'TextFile' option. see in picture.-
That's just a text file. It does nothing.
As with any other file, you are free to include it in your project as a resource, and perhaps load it at runtime via GetResourceStream() or something.
To expand on the previous answer, text files can be very useful in a number of ways, especially if you have multiple people working on a project. Adding a todo list or instructions to other developers in the project tree itself makes them more obvious.
It also helps to keep them up-to-date when using code revision control.
(Would have commented but not enough reputation... the previous answer sums it up)
I add 'TextFile' in project ,now problem is ,How to access it(Or Open it) on Button click Event.

How do we can create the attractive/customised installer for our .net application?

I am usually using Setup and Deployment template provided by visual studio. Is it possible to enhance default forms provided in that. or is there anything else to create the customized and attractive installer.
Aim :
1. I like to ask the user for pre-requested information to initialize the application during the installation process.
2. I like to prevent app.config by toching from user.
3. I like verify the collect the connection information during installation as well as like to verify that by connecting with given data source.
please provide good direction if i am in wrong path. - thanks
Wix is what you need
Yes, you can do all these things with the built in setup project in Visual Studio.
You can add a new user interface dialog box with text boxes, check boxes etc.
Write a custom action the handles these values and store them in some configuration file.
The app.config shouldn't be touched by the user anyway. If you are using the built in configuration classes in .NET, the user settings will be stored in a separated file in the user's application data folders.
As in #1, you can use custom actions for this kind of functionality.
The built in setup project has very little/no means of customizing the look and feel. For that you will have to use either 3rd party components/installers or use WiX and design setup screens/dialogs by yourself.
I use Inno Setup (http://www.innosetup.com/isinfo.php), its free and very configurable, it can also run your own applications as helpers to do very specific tasks.
Why not try other install systems like InstallShield or, if you really want to customize go for NSIS (Nullsoft Scriptable Install System)? NSIS Download

ASP.NET Web User Control Library

We have a bunch of user controls we would like to pull out of a web application and into a separate assembly/library, and I thought it would be as simple as creating a class library and pulling the ascx and ascx.cs files into the project, and compiling a DLL to be reused among our applications.
This was not the case, however.
Our ultimate goal is to have a single distributable DLL (similar to how Telerik distributes their controls) that we can throw into any web application. The steps here: Turning an .ascx User Control into a Redistributable Custom Control were very simple to follow, however this results in many files named controlname.ascx.guid.dll, which is not the desired result. I couldn't even get these to work anyways, since we have additional classes that need to be compiled into the assembly.
Has anyone successfully created a web user control library in .NET (we're using 3.5 here)? I can't seem to find a nice step-by-step guide.
I realize this is an old topic, but if anyone is looking for a solution for creating reusable user control libraries, it turns out it's fairly simple. Here are two good step-by-step guides along with source code:
From MSDN: Turning an .ascx User Control into a Redistributable Custom Control
From Code Project: Straight way to create ASP.NET user controls library
The second link provides a solution to the multiple dlls created by the first link.
Edit- (2) Seems to be a dead link. Here's the new link
https://www.codeproject.com/Articles/30247/Straight-way-to-create-ASP-NET-user-controls-libra
If you want to share controls among project, my experience has shown that the best way is to build custom asp.net server controls instead of usercontrols. User controls are good for sharing within the same project, but not over multiple ones.
For this purpose I suggest you to build a set of custom server controls inside a class library and use that on all of your projects.
This book does quite a good job at explaining the basics of creating server controls
Edit:
I'm currently developing a .net web server control library. I actually didn't follow any step-by-step guide. I mostly considered using the book I mentioned above and the MSDN library + Reflector, which is a great tool for inspecting existing MS server controls and learning from them.
I found the tutorial Creating and Using User Control Libraries but it seems like a bit of a hack as it relies on a post-build command line event to copy the user controls from one project to another.
Somewhat late, I admit.
To create a re-usable library of user controls; create a new Web Application Project, delete all the scaffolding, add a (number of) user control(s). Create a Web Deployment Project from the Web Application Project, in the WDP properties choose the option to Merge all control output and assign a name for the library and ensure that Allow this website to be updatable is NOT checked.
Build the WDP and use Reflector to examine the generated library; you'll see that it contains an ASP namespace and the types you carefully crafted have been renamed i.e. usercontrol_ascx. In your target website(s) add references to BOTH the output dlls from your WDP, add a system.web/pages/controls node to web.config using the namespace ASP and the name of the assembly that you defined in the WDP.
Now when you use the library in a page (for example) you must use the alias that you defined in web.config and the typename as seen in Reflector i.e.
<ucl:usercontrol_ascx ... />
I found it useful to add a dependancy for the website(s) on the WDP so that the WDP is built before the websites; now I can change the user controls in the WAP without having to remember to build the WAP before building the website(s).
I hope that someone finds this useful as it cost me a few grey hairs getting to this stage and still have VS do its 'automagically' thing.

Categories