|
|
I am currently developing software that I am planning on selling.
I have created a Setup Project in .NET to install the software to a user's computer.
However, I need to implement logic that provides a 30-day free trial. The software should expire after 30 days unless the user purchases a key.
Can someone here give me some guidance on how I can implement this?
|
|
|
|
|
The easiest way is to check the date your file was created, and check if it was 30 days ago. Another way is to write something somewhere that stores the date first run, and check if it was 30 days ago.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not sure if checking the date the file was created will work.
If the validation was based on the file create date then couldn't the user simply uninstall the existing app and then reinstall it?
When you say "write something somewhere that stores the date first run, and check if it was 30 days ago" are you suggesting that I write to the registry or some other file on the user's computer?
|
|
|
|
|
Member 3919049 wrote: If the validation was based on the file create date then couldn't the user simply uninstall the existing app and then reinstall it?
In fact, the file system will use the original date, if the file is in the same location.
Member 3919049 wrote: When you say "write something somewhere that stores the date first run, and check if it was 30 days ago" are you suggesting that I write to the registry or some other file on the user's computer?
Of course, how else could you do a 30 day trial ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian,
What would stop File.SetCreationTime() from changing the date?
|
|
|
|
|
For example without thinking to much:
1. take the expiration date
2. encrypt it with some symmetric encryption
3. store it somewhere for reference (settings file, registry, whatever)
4. on program start get the current date and compare with the encrypted expiration date.
This isn't a bullet-proof solution, since you're using symmetric encryption, and also the .net assembly can be quite easy
analyzed with reflector. But it's a start
|
|
|
|
|
Wouldn't even need be reflected, you could monitor the registry entry access and delete the key, then you're app wouldn't know it has already been ran...
Normally the best solution is from a wrapper application that controls your program, though these are also broken but not as hard as other methods...
One way I do it is to write a file somewhere (deep random path to in application data folder) Then when I want to find that file I just use DirectoryInfo to loop though the parent and sub directories. To see if it is there. This can be broken with reflection too, but other monitor tools can't really pick the ONE file that made it work.
Actually a combination of the answers above would be your best solution (heh) more checks the harder to break
|
|
|
|
|
First off all if you don't use the registry you could use a crc/hash check on the keyfile to know if it was tampered with. However I don't see the catch in the random path (using filemon I can anytime see what file you're using).
|
|
|
|
|
It's simple to go around Sysinternal's filemon / process monitor
For this example if the application is registered write a empty file call "appreg.dat" to the application's run path, then add this code
DirectoryInfo di = new DirectoryInfo(Application.StartupPath);
FileInfo[] rgFiles = di.GetFiles("*.*");
foreach(FileInfo fi in rgFiles)
{
if (fi.Name.ToLower() == "appreg.dat")
{
MessageBox.Show("This is the pro version!",this.Text);
}
}
Run filemon/procmon and see the file IO results. Save the log and clear the contents, delete the file and rerun the test and compare the results....
The thing is you'd have to work backwards on this example to solve it, having only a unregistered copy wouldn't help much as the registered file doesn't ever exist. You can make this much more secure by reading multiple directories and looking for more than one file ect.. This still isn't the best method, though if combined with a few others it can become fairly safe (except for reflection) or decoding the CIL. You'd need Dotfuscator and other tools to make it more safe.
I didn't say this before because it is sort of off-topic. Yet, the fact remains it is impossible to make a trial which contains full functionality DIE and not be brought back to life. The best thing is to make your trial a different program with limited use and then distribute the full version after they pay. Then someone who pays can still leak the real app to the general public, so pick your poison.
|
|
|
|
|
Hey,
I searched everywhere but was unable to find a solution somewhere:
I'm binding to a WinForms (2.0) DataGridView.
When I bind to the List(Of MyType) (List<mytype> in C#) it shows up just fine in the DataGridView. However MyType contains a List(Of MySubType) and I want each MySubType to appear as a column in the DataGridView.
What I did was wrapping up MyType like "MyTypeDescriptor : ICustomTypeDescriptor" (Implements) which exposes each MySubType as a property (I also needed a "MySubTypePropertyDesc : PropertyDescriptor" (Inherits) for this).
So I try to bind my new List(Of MyTypeDescriptor) to the DataGridView. What happens now is that the first row shows up correctly but all rows after that are a copy of the first one.
Considerations:
* The content of the List(Of MyTypeDescriptor) is correct. ie it contains the wrappers around the different MyType objects.
* When I bind the different "MyTypeDescriptor" to PropertyGrids, they show the expected data.
* I tried implementing the ITypedList but got the same incorrect result.
Anyone has an idea what I am supposed to do here?
Cheers,
Wouter
|
|
|
|
|
Wouter,
Did you get an answer? I'm having the exact same issue!
Thanks!
|
|
|
|
|
This was quite a while ago
I finished the project but I have no idea what kind of workaround was required...
At my current project we use Janus GridEx instead of the standard WinForms DataGrid(View) which is pretty neat.
http://www.janusys.com/controls/
|
|
|
|
|
Using an icon editor I create the app icon. It contains 48x48, 2 - 32x32, and 2 - 16x16 images (five in all). The first three are for the application, the last two (32 & 16) are for the document file(s) associated with the application.
The problem is that the DefaultIcon key in the registry does not associate the correct icon with the document files.
Example:
C:\Program Files\Test App\TestApp.exe,0 <- regardless the value the results are the same! X| Is there a "How to" for using icons with a VS 2005 Windows Form app?
Thanks,
Mark
|
|
|
|
|
I think you're getting caught out between how .NET handles resources and how Win32 does. Explorer uses the old Win32 model for resources; .NET has a new incompatible model.
You also need to understand how icons work. Logically, each of the images in the same icon file represent the same icon. Windows or .NET pick the appropriate image out of the file depending on the size of the image requested (e.g. large vs small icons) and the screen colour depth (the system will use the highest available colour depth in the icon file that's less than or equal to the colour depth of the screen, for the requested icon size). If it doesn't have an icon in the requested size it will synthesize one by scaling up or down the icons that are available.
What you need to do is separate your images into three icon files: one for the app, and one for each of the document files. You then need to build a Win32-style resource file using a resource script (.rc file) and the Win32 resource compiler, rc.exe, to generate a .res file. You can then go to the Application tab in the project properties in Visual Studio 2005 and select Resource File rather than Icon, and select the .res file you generated.
I think you will need to add a version resource to the .rc file as well, if you want the Version tab to appear in Windows Explorer with your company name information.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Once I ran through the process of using the resource compiler (rc.exe) to create the .res file it occurred to me that I had done this before! Some time ago. Now Windows Explorer shows the correct icons for the document files.
Thanks for the help.
Mark
|
|
|
|
|
I have made a form, but i want to remove it from my windows taskbar, it doesnot mean i want to move it to notification area or want to hide, i want it on the scrren and the same time i dont want it on windows taskbar.
|
|
|
|
|
tamour wrote: have made a form, but i want to remove it from my windows taskbar
Select the form, go to 'Properties' and change the ShowInTaskbar property to false.
|
|
|
|
|
Buddy tahnku very much. In fact really really very much.
|
|
|
|
|
Hi,
From a Windows Form I do a call to a method in an external class. I want to display a Progress Bar that show me the progress of this method.
The progress of the method is increasing in it and my problem is that i don't know how can i update the Progress Bar.
Can somebody help me?
Thanks & sorry for my awful english.
|
|
|
|
|
|
Hi
I have some problem When I'm trying to make install package.
The package what I work is very big program suite. so the package have some editions : Home, Basic, Pro Editions.
What i want is that when user installs this package and enters SN, installer choose one edition which is selected by user and install.
But The tool I'm using is Advanced Installer. but this tool doesn't support what i want.
Are there any tools?
If you know about the tool what i want, please tell me.
Thank you
|
|
|
|
|
I'd recommend NSIS, it's a very powerful installer and use it whenever I need to create an installer.
There is a bit of a learning curve to it but once you've learnt it you won't regret it.
|
|
|
|
|
I have a main form which instantiated with this command like everybody does:
Application.Run(new pdMainForm());
Problem is I want to access one of its control properties from another form but since it does not provide any instance name I couldn't find the proper way to get one of the form's control properties.
How can I access pdMainForm's control properties from another form?
Thanks in advance.
|
|
|
|
|
I code in VB.Net, and I don't typically use Application.Run() for forms the way you showed in your example. We would do something like pdMainForm.Show() , but I think I understand the concept and what you need to do is create a pointer for your main form before you start running it. So you would declare a variable with the DataType of your form's class first. Then you can run it and later you can still access it's properties the way you want to, so something like this I'm guessing:
Dim myMainForm as New pdMainForm<br />
Application.Run(myMainForm)<br />
<br />
Dim mySecondForm as New pdMainForm<br />
mySecondForm.Text = myMainForm.Text<br />
Application.Run(mySecondForm)
If this isn't what you were looking for, perhaps you could show us some more of your code and explain a bit more.
Hope this helps.
|
|
|
|