Best Practice for Obfuscating a C# Visual Studio DSL Solution as VSIX - obfuscation

I was wondering if anyone has any advice for obfuscating a DSL?
Background - We have created a DSL which we will putting into the Visual Studio Gallery as a VSIX file.
We already use dotfuscator for our obfuscation on other projects but I would like to know if there are any best practices or issues when packaging a DSL for deployment as a VSIX

Disclaimer: I am a developer at PreEmptive Solutions, the makers of Dotfuscator.
As long as your DSL assemblies are managed code you can use Dotfuscator on them. The 4.6.1005 release of Dotfuscator Professional provides support for .NET 4.0 Beta 2 assemblies. As long as your support contract is current, PreEmptive will provide support in the event you run into any issues.
The only external process you will need to implement is one to update your VSIX file either manually or via a script that will replace the unobfuscated assemblies in the original VSIX with the obfuscated ones output by Dotfuscator. See http://blogs.msdn.com/quanto/archive/2009/05/26/what-is-a-vsix.aspx for details on the structure of a VSIX and how to work with them.
While the 4.6.1005 version of Dotfuscator has been significantly updated to accept and emit XAP files, ClickOnce manifests and directories we have not yet implemented the ability for Dotfuscator to natively process VSIX assemblies. I have put this enhancement on our request list :) .

Related

Prerequisites button disabled - MSI installer

I have created an .msi installer. I want to further add prerequisites (such as .Net) but when I go to Setup Project properties, the Prerequisites button is disabled. How do I enable it?
Other details:
I'm using VS 2015, SQL Server 2008 R2, .Net 4.5.2, C#, WinForms, Win
10 Pro x64
My setup project is in the same solution as the main project
Prerequisities in Visual Studio Projects
In Configuration at the top of the dialog, did you try to select either Release or Debug? That should enable the Prerequisites... button.
Unecessary, outdated prerequisites?
One pet-peeve of mine: is it really necessary to include the .NET runtime as a prerequisite when most users have it installed by their deployment team (corporations) or via Windows Update (home and small office users)?
If there are security updates for the runtime, your old, embedded runtime is just a nuisance to be honest. Corporate packagers spend a great deal of time removing runtimes and prerequisites for corporate deployment where all runtime components are packaged separately in the corporate standard format. Perhaps consider making a special corporate "large scale deployment" version of your setup bundle? Just a zip with components will be very appreciated, along with a one page PDF on how to deploy them.
For the .NET framework you could just add a launch condition to abort the installation if the runtime is not found, and tell the user to get the runtime via Windows Update or from their system administrator or deployment team.
Just a thought I wanted to share with you. Prerequisites can really bloat a setup - especially when they are almost never needed like the .NET framework. In the future we will certainly pull prerequisite packages straight from online repositories and not embed anything in our main setups (and probably struggle with new security issues from that approach).
What version of the .NET Framework is included in what version of the OS?
Selectively disable versions of the .NET Framework (.NET versions overwrite each other)
WiX and other deployment technologies
Setup projects are rather limited. If you find yourself needing more features, you might want to check out the WiX toolkit.
Here is a previous answer on WiX and other deployment tools that seems to have been helpful for people: MSI vs nuget packages: which are is better for continuous delivery?

MvvmCross for WPF and Xamarin.Mac: is it possible?

I'd like to ask anyone out there whether is possible, as of today, to develop a Windows/MacOS cross platform application using WPF (in Visual Studio) and Xamarin.Mac (in Xamarin Studio for Mac). I searched the web, twitted people (Stuart, I know you pointed me to loqu8 build some days ago, but I'm just stuck :P) but nothing really useful came up. So, my questions are:
First and foremost: is it possible?
Is it production ready? If not, how much stable it is? Are there any plans for improving it in the next months?
How do I use MvvmCross in Xamarin Studio, since it seems that NuGet isn't supported on MacOS, and NuGet packages don't target Xamarin.Mac anyway?
How do I create a PCL in Visual Studio since Xamarin.Mac isn't insalled on Windows? Do I have to create it on MacOS and the copy the project in Visual Studio?
More could follow...
Thanks for any answers!
First and foremost: is it possible?
Yes. Several developers have used it.
But it's not a "main target" for MvvmCross - our main focus is still on Windows, Droid and iOS which is what users have requested the most.
Is it production ready? If not, how much stable it is? Are there any plans for improving it in the next months?
It's not included in the main nuget packages - because nuget doesn't really support monomac or xammac packages very well. There are no plans to change this that I know of.
You have to build it yourself. You can do this from the main mvvmcross repo - or from branches like https://github.com/loqu8/MvvmCross/ who have done a lot of work on it.
How do I use MvvmCross in Xamarin Studio, since it seems that NuGet isn't supported on MacOS, and NuGet packages don't target Xamarin.Mac anyway?
Currently the best advice is to build and use the assemblies yourself.
How do I create a PCL in Visual Studio since Xamarin.Mac isn't insalled on Windows? Do I have to create it on MacOS and the copy the project in Visual Studio?
You can add additional PCL targets using the XML files - see old posts like http://slodge.blogspot.co.uk/2012/12/cross-platform-winrt-monodroid.html about how we previously did this for MonoDroid/Touch
To build MonoMac/XamMac projects in VS, see http://tofutim.blogspot.co.uk/2013/11/adding-monomac-and-xammac-to-visual.html
Cross platform WPF = speaking language of all people around the world in the best way possible
Cross platform WPF+(Blend and Visual Studio) = Doing poetry for all languages around the world in the best way possible
What better tool a programmer on the earth could wish for?
C# will become the most powerful cross platform programming languae

How to deploy WPF application with WIX

I have started to use WIX to deploy a WPF application. I have created the .wxs file with the desired interface features etc...
My questions is how to distribute the required .Net files that support my WPF executable? Not the .net framework or sql server express, but the dependencies needed to run my executable.
Should the process include building a msi with VS Installer, then including that msi into my WIX script and running that inside of my WIX msi?
Or, what is the correct process for distributing a WPF executable with WIX?
I don't think your question pertains to WiX or WPF at all. What you need to ensure is that you package up the necessary dependencies along with your installer, whatever they may be. Referencing your dependency files in your installer script should be sufficient.
Here's the process that I follow for any application.
1) Start with a clean VM that represents the least common denominator of a machine I want to target. Let's say WinXP SP2 32bit.
2) Deploy my application by hand and record all of the steps in a word document. Then try those steps on other OS's to make sure you didn't miss anything.
3) Take each of the steps in my document and implement them in WxS. Keep in mind that Windows Installer and Windows Installer XML is a declarative programming language not an imperative programming language. You don't tell it to xcopy files from dir a to dir b, you describe the directory structure and the installer takes care of it.
BTW, of the things you mentioned, your asking for help with what I consider the simple stuff and excluding the harder more complicated stuff.
As an alternative way, you might see also this post Embedding dlls in a compiled executable to embed all the dll needed (like the interop ones for example) using Costura.Fody. Using WIX there is no more need to add any dependent dll as components in the .wsx file.

How to make an setup just like Devexpress installation (v11.1.8)?

I want to pack my file in to a single executable file "setup.exe", my application is written in c# and WPF, I know that there are a lot of applications out in the store for creating a installation pack, but the point is which one would help me to build my installation pack just like Devexpress dose ?
For an UI similar to DevExpress you will need a setup authoring tool which offers an external UI and rich graphics.
Advanced Installer and InstallShield have some great UI themes which can get you started. You can also find a list of setup tools here:
http://en.wikipedia.org/wiki/List_of_installation_software
You'll probably have to roll a custom solution for this one. I expect nothing less of the Devexpress team then creating their own installer.
If you're application is not heavily bound into the registry and all kind of windows folders it should not be that hard to create an application that extracts some files into a directory and create some great UI while copying.

WPF embed .net libraries into exe file

Is it possible to embed all .net dependencies to the final exe file because I want it to run on every windows machine even without preinstalled .net?
Use ClickOnce, and setup the dependencies, so that it installs the prerequisited .Net framework.
ClickOnce is good for dealing with the deployment of your application.
To embed all .net dependencies you can use ILMerge or, even better, this approach by Jeffrey Richter (which is recommended from inside the ILMerge website too).
I am not sure about the lagality of this but you can possibly use reflection to get the code from the parts of the .NET framework which you are using and re-create them as your own classes. Then use those classes when building your application.
Edit: I am not sure that you can reflect the entire .net framework though.

Resources