Licensing WPF, Silverlight and WP7 assemblies - wpf

I am looking for a solution to license a WPF, Silverlight and WP7 assembly. The assembly in question is a chart control which has a single API for use across platforms. I am in the process of creating a separate MSI for each platform (WPF, SL, WP7) which users will be able to download and install. This will register the assemblies in their GAC for development use.
What I would like to do is ensure that a single development license is only used by a single developer. It doesn't have to be super secure, just enough to deter would-be hackers. Ideally a solution that covered all three platforms would be beneficial.
I already have a cross-platform obfuscator which I am very pleased with. Shame this doesn't include licensing!
Edit: Additional requirements are that I will be allowing users to download updates for up to one year from purchase date, however the assemblies they purchase will be available for their use indefinitely whether or not they update. Assemblies are to be redistributed so any licensing model must be redistributable on WPF/SL/WP7 platforms.
Your suggestions / comments welcome.
Best regards,

For your requirements that the licencing methodology 'will "do the job" and prevent low-level licence abuse' I would personally recommend not getting too fancy; that is, to avoid the use of web-activated/maintained licencing. My advice would be similar to the approach outlined here.
Select a symmetric encryption algorithm using the one of the .NET libraries as described in the link above.
Create the required encryption key using a random generator (if you contact me I am happy to share a piece of code I developed to generate a variety of random strings/keys for any required key size), there are also .NET classes to help you do this yourself by generating pseudo-random numbers (RNGCryptoServiceProvider).
Transform/’custom-hash’ the key to provide a new 'hashed encryption key'.
Use this key to generate an Initialisation Vector (IV) and encrypt your licence file.
How you now deploy the application (in terms of licencing) is up to you. The two methods below will work for all three application types above and will offer some degree of consistency for the licencing of each of your products. The above method uses two files for licencing. 'ProductKey.myExtension' and 'LicenceFile.myOtherExtension'. The first contains the randomly generated key, that will be 'hashed'/transformed in the same way as in the licence generator application (you will need a separate (small) application to ‘cut’/create the licence files). The second is the encrypted file with user info, licence period etc.
A. You could now provide an install package for your application that will install your application in the relevant directory (i.e. C:\Pogram Files etc.) without providing the licence files, in which case you can deploy the licence files with a licence installer. The licence could then separately be installed for each user employing `Environment.SpecialFolder's to ensure each user has their own licence (of course this would assume that the 'Administrator' installed the application in the first instance for all users and that the licence install pack would be run on a user-by-user basis). Note: I am currently not familiar with WP7 applications and the specifics in this case.
B. The second way would be to allow individual users to install the application, and to install the relevant licence files upon the applications installation.
I have deployed several WinForm applications using this methodology after an extensive research period and it seems to work well. I hope this is of some help.

Related

Flat file database for CD

I have a .csv file with about 5-8 columns and about 1mil. rows and I would like to have it stored in simple flat file database.
Overall this should be a standalone application (one file with *.exe, installable under Windows). The application would allow basic search on the 5-8 columns. There should be very simple user interface.
This application is to be written on CD and distributed to users so should be fairly simple to administer/use.
Questions:
1) Is there already some software that would allow me to build such a application?
2) If not which program would suit best to build such a application?
I would task a programmer to build such a application if I would have clue as to what program to use (finding programmer based on the best program you would recommend).
Again, very simple application, light weight with no additional unnecessary options, dependencies etc.
My Visual Database (http://myvisualdatabase.com/)
from site:
A simple development environment databases, without the help of
specialists and programming skills, you will create a Windows
application databases. It can be as simple telephone directory and
accounting system in your business.
The result of your work will be a Windows application that does not
require installation and third-party components and the ability to
work directly from USB Flash drive.
This software uses sqlite.
Here you can find example, how to import csv file
http://myvisualdatabase.com/forum/viewtopic.php?id=1448
also for import you can use SQLite Studio

Multiple-domain security with SSDT .sqlproj projects?

I'm doing a small pilot project trying to implement Sql Server Data Tools sqlproj projects in order to better bring our databases under source control. In my organization, we have separate no-trust domains for test environments of various purposes, so these domains of course have their own isolated active directory accounts.
The documentation is still somewhat sparse and I don't really know where to go for more information on this toolset, especially considering the extraordinary amount of churn in Visual Studio's history of database assets.
So far, the only idea I've really had would be to make separate sqlproj projects specifically for the security objects each separate domain, separate from the other schema objects. My hope is that somehow I can tie my actual database schema to those at deploy time and also to somehow switch which security project I'm using in the build. I have no idea if that's feasible though.
Has anyone that uses Visual Studio sqlproj projects had to deal with this? Is there a best practice for this kind of thing?
If you have different settings for each environment then the easiest is to either leave them out and not delete them when you deploy or to have a post deploy script that sets them up manually.
Normally for handling different configurations I would suggest using sql cmd variables (on the properties of the project there is a page for setting these up) but when you create a login you cannot use a variable to create it so that falls over!
There is an example on how to setup a post deploy wrapper for just this case:
http://schottsql.blogspot.co.uk/2013/05/ssdt-setting-different-permissions-per.html
Good luck with ssdt, there are some strange quirks but it enables so much!

VS2010 Different publishing locations based on configuration

I'm trying to divide my solution by three configurations:
Development
Testing
Release
All above will have different publishing location, so users can work with release, do their test in testing and see what is new in development release. All three versions will be build with different name postfixes and icons and installed on each user workstation.
For now I get :
Unable to install this application because an application with the
same identity is already installed. To install this application,
either modify the manifest version for this application or uninstall
the preexisting application."
I can't even install this more than once at one workstation.
So What can I do to achive this?
You can not install the same application multiple times unless you change the deployment. The easiest way to do this is by changing the assembly name. This article explains this.
As time past, I can now see that the solution was quite close, just required me to be able to specify my requirements first.
So, now I can tell that it mostly depends on number of such configurations:
if it is limited and low, i.e. live/test/dev, you can have each as separate project in solution, like AppLive, AppTest, AppDev, this requires refactoring to move everything that is common into separate projects, but it makes code and releases clearer and easier to manage.
if those configurations are unlimited, or number is high, than way to go is to load configurations from file and pick one from the pool based on custom logic.
Currently I'm using mix of both, as I want to be able to release test versions earlier than live, but also my application is used by multiple branches, and each of them has some unique styling, logos and such, so this is applied from embed xml file, and proper set is identified based on Active Directory entries.

Silverlight vs ActiveX for lightweight app with system access

Just an R&D question. We need to develop an application that can be run in a browser that has the capability of performing some system checks to gather support information to be emailed to us. These checks will include basic system information, but also will need to scan the filesystem and pull out version information about various DLLS, executables, and .NET assemblies that might be installed. The idea being that we can direct a client to a page and have the application gather the relevant information needed for support, and potentially even populate some database fields. We need it to have as small a footprint as possible.
I've worked with ActiveX before, and know it is capable of these things, but particularly on modern systems security is a nightmare to get around, with a lot of people blocking ActiveX altogether. Is Silverlight easier to deliver to clients? Does it have a lighter footprint? Is it even capable of doing these things?
Silveright has access to isolated storage, but I don't think it can do what you are looking for (I may be wrong). As for footprint, if I remember correctly, the runtime is reasonably small, and the .xap packages are limited to 4Mb.
Silverlight out-of-browser has access to the file system. http://msdn.microsoft.com/en-us/library/dd550721(v=vs.95).aspx#special_features_for_outofbrowser_applications
If you intend to run your app in the browser, you will still have to configure the trust as if it where oob. http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx
However, iTunes has a neat way of doing something somewhat related. It has a custom protocol (itms://) that allows the browser to invoke a client side program (iTunes). Then you can embed html in a webpage that passes parameters as command line arguments to that app. The website also knows if the iTunes is installed by a cookie. We this in mind, you might be able to encourage your users to install some small app that setups the custom protocol on install. You could pass command-line parameters to it from the web, and the app will push information from the client back to the server.
To create a real-time experience, you could use sockets + more javascript to update the page with the info you just got off the machine.
HTH,
Silverlight runs in a pretty restricted silo and can't do a lot of low level things - such as checking the file system. So I would say it does not fit your use case, unfortunately.

C# source control that allows me to have multiple branches of code for various "editions"

Can someone recommend a source control product that does all of the following:
Seamless integration into VS 2008 Pro
Will allow me to create different "editions" of a program (like "express" and "pro") - maybe with branching?
Will allow me to track changes for specific client requests. Say I have four clients, 2 on express, 2 on pro. I would be able to create specific, customized changes for all clients while still maintaining a singular codebase.
I'm not sure if something like VisualSVN can handle this, but there must be a product out there.
Virtually every source control will satisfy the #2 and #3 requirement with branches.
For #1 it's more tricky. If you really want a Seamless integration (capital S) then Team Foundation Server is your only choice. (It's very expensive)
Otherwise virtually all the major source control systems will have some sort of VS plugin, but the plugin usually doesn't work very well.
The two most popular free source control systems are:
Subversion
git
The best way to create different additions of your software using the same code in all of the different versions it to use pre-processor directives to conditionally compile your software based of flags that you set.
For information on conditional compilation please see the following links:
.NET: http://msdn.microsoft.com/en-us/library/9ae6e432%28VS.71%29.aspx
Java: http://weblogs.java.net/blog/schaefa/archive/2005/01/how_to_do_condi_1.html
C++: http://www.devarticles.com/c/a/Cplusplus/C-plus-plus-Preprocessor-The-Code-in-the-Middle/3/
I hope this answers your question I use this alot when developing different version of applications for different platforms.
An example of this is an application that I developed in c# for both a server and mobile device implementation. Each had different ways of calling functions in .NET libraries but the logic was the same so I used preprocessor conditional compilation to compile to correct code for each platform but leave the logic intact.
From experience you only need integration with Visual Studio if you need to check out the file before editing it (a-la SourceSafe) and the file is read-only until then.
Having used SourceSafe I went on to using SVN and absolutely never looked back. Then I switched to git and again never looked back on SVN or Sourcesafe.
I can't comment on Team Foundation source control or Mercurial, I've never used those. At this stage I would recommend git over SVN as it's more suited to working with a single source tree that has minor changes between lots of branches. You can do the same thing with SVN but found the process of switching the working copy to another process painful.
Team Foundation Server provides the best seamless integration to VS 2008, but of course its not free (i agree that its very expensive)
have you tried using AnkhSVN? its got a pretty good integration for VS 2008 and SVN. so far it gives me the VS-SVN integration that I need, so you might want to check it and see if it fits your needs.
you can use TortoiseSVN, but I suggest installing CollabNet's SVN server, because AnkhSVN integrates seamlessly with it, plus you dont have to worry about major installations
It's only three months until VS 2010 is in final release (March 22, 2010). For MSDN subscribers, TFS will be integrated into Visual Studio (all levels except Express). MSDN subscriptions that include Visual Studio (any level) will include TFS with a one-seat license. TFS 2010 will run on Vista or Windows 7. SharePoint is no longer required, but you still need it if you want 100% of TFS features, like reporting.
It's all available now in beta; I'm running TFS on my laptop.

Resources