<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — [Script] Create trial project]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=1434</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=1434&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [Script] Create trial project.]]></description>
		<lastBuildDate>Mon, 15 Jun 2020 22:32:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=36920#p36920</link>
			<description><![CDATA[<p>jean.brezhonek,</p><p>thank you, will try this out!</p><p>Anakin</p>]]></description>
			<author><![CDATA[null@example.com (anakin)]]></author>
			<pubDate>Mon, 15 Jun 2020 22:32:35 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=36920#p36920</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=36913#p36913</link>
			<description><![CDATA[<p>Hello Anakin</p><p>Try this snippet : After 30 days trial, it will shows a nag screen</p><p>procedure Form1_OnShow (Sender: string; Action: string);<br />var&nbsp; &nbsp;reg: TRegistry;<br />&nbsp; &nbsp; &nbsp; &nbsp;iDays: integer;<br />&nbsp; &nbsp; &nbsp; sKey: string;<br />begin<br />&nbsp; &nbsp; &nbsp;sKey := &#039;&#039;;<br />&nbsp; &nbsp; &nbsp;reg := TRegistry.Create;<br />&nbsp; &nbsp; &nbsp;reg.Access := KEY_ALL_ACCESS;<br />&nbsp; &nbsp; &nbsp;reg.RootKey := HKEY_CURRENT_USER;<br />&nbsp; &nbsp; &nbsp;reg.OpenKey(&#039;software\&#039;+APP_NAME,true);<br />&nbsp; &nbsp; &nbsp;if not reg.ValueExists(&#039;StartDate&#039;) then reg.WriteDate(&#039;StartDate&#039;, Now+30); // trial period is 30 days</p><p>&nbsp; &nbsp; &nbsp;iDays := Trunc(reg.ReadDate(&#039;StartDate&#039;)) - Trunc(Now); // time left days<br />&nbsp; &nbsp; &nbsp;sKey := reg.ReadString(&#039;Key&#039;);</p><p>&nbsp; &nbsp; &nbsp;reg.CloseKey;<br />&nbsp; &nbsp; &nbsp;reg.Free;</p><p>&nbsp; &nbsp; &nbsp;if sKey&lt;&gt;&#039;&#039; then<br />&nbsp; &nbsp; &nbsp;begin<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if CheckKey(sKey) then Exit;<br />&nbsp; &nbsp; &nbsp;end;</p><p>&nbsp; &nbsp; &nbsp;if iDays &lt; 1 then<br />&nbsp; &nbsp; &nbsp;begin<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; frmNagScreen.lbTrial.Caption := &#039;Trial period is over.&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; frmNagScreen.ShowModal;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit;<br />&nbsp; &nbsp; &nbsp;end;</p><p>&nbsp; &nbsp; &nbsp;isAllowRun := True;<br />&nbsp; &nbsp; &nbsp;frmNagScreen.lbTrial.Caption := &#039;Demo version. Time left: &#039; + IntToStr(iDays) +&#039; days.&#039;;<br />&nbsp; &nbsp; &nbsp;frmNagScreen.ShowModal;</p><p>end;</p><br /><p>procedure frmNagScreen_bOrderPage_OnClick (Sender: string; var Cancel: boolean);<br />begin<br />&nbsp; &nbsp; OpenUrl(&#039;http://yourpage.com&#039;);<br />end;</p><p>function CheckKey(sKey: string): boolean;<br />begin<br />&nbsp; &nbsp; Result := False;<br />&nbsp; &nbsp; if (sKey=&#039;FJKS-TJKS-WEEW-NMVV&#039;) or<br />&nbsp; &nbsp; &nbsp; &nbsp;(sKey=&#039;NNMF-QPOV-FDDK-ZUIF&#039;) or<br />&nbsp; &nbsp; &nbsp; &nbsp;(sKey=&#039;VCJK-RGJJ-CWER-GHFJ&#039;) then Result := True;<br />end;</p><br /><p>begin</p><p>end.</p><br /><p>Hope this can help you<br />JB</p>]]></description>
			<author><![CDATA[null@example.com (jean.brezhonek)]]></author>
			<pubDate>Mon, 15 Jun 2020 16:33:10 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=36913#p36913</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=36862#p36862</link>
			<description><![CDATA[<p>Hi Drivesoft,</p><div class="quotebox"><blockquote><p><strong>Another project with serial number:</strong><br /><a href="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=1387&amp;download=1">http://myvisualdatabase.com/forum/misc. … download=1</a></p></blockquote></div><p>I tried this one above in one of my projects and it works, but after 30 days, when the user closes the &#039;Demo Form&#039; the user can still use the application and the Demo Form just displays &#039;your trial is over&#039;. </p><p>How to make it that after 30 days, the application cannot be opened (or users will be directed to a website) unless they type-in a license key? </p><p>Anyone?</p><p>Thanks!</p><p>Anakin</p>]]></description>
			<author><![CDATA[null@example.com (anakin)]]></author>
			<pubDate>Sun, 14 Jun 2020 22:40:02 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=36862#p36862</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=32322#p32322</link>
			<description><![CDATA[<p>Serials for duration base, please visit the topic.<br /><a href="http://myvisualdatabase.com/forum/viewtopic.php?id=3124">http://myvisualdatabase.com/forum/viewtopic.php?id=3124</a></p>]]></description>
			<author><![CDATA[null@example.com (Asifmute)]]></author>
			<pubDate>Wed, 14 Aug 2019 14:05:39 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=32322#p32322</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=32156#p32156</link>
			<description><![CDATA[<p>How to make specific key for specific time...<br />for example 120 day,180 day ,777 day ,life time etc</p>]]></description>
			<author><![CDATA[null@example.com (Asifmute)]]></author>
			<pubDate>Sun, 04 Aug 2019 18:19:51 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=32156#p32156</guid>
		</item>
		<item>
			<title><![CDATA[[Script] Create trial project]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=7801#p7801</link>
			<description><![CDATA[<p>It allows you to make your project work with a limited period, such as 30 days. </p><br /><p>Also giving the client a program for testing, you can delete the file from the folder Script.pas Script, to the script could not be modified.</p><br /><div class="codebox"><pre><code>procedure Form1_OnShow (Sender: string; Action: string);
var
   reg: TRegistry;
   iDays: integer;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_ALL_ACCESS;
     reg.RootKey := HKEY_CURRENT_USER;
     reg.OpenKey(&#039;software\MyVisualDatabaseTrial&#039;,true);
     if not reg.ValueExists(&#039;StartDate&#039;) then reg.WriteDate(&#039;StartDate&#039;, Now+30); // trial period is 30 days

     iDays := Trunc(reg.ReadDate(&#039;StartDate&#039;)) - Trunc(Now); // time left days

     reg.CloseKey;
     reg.Free;

     if iDays &lt; 1 then
     begin
          if MessageDlg(&#039;Trial period is over.&#039;+#13+&#039; Do you want to visit a order page?&#039;, mtInformation, mbYes+mbNo, 0) = mrYes
              then OpenUrl(&#039;http://yourpage.com&#039;);

          Form1.Close;
          Exit;
     end;

     if MessageDlg(&#039;Demo version. Time left: &#039; + IntToStr(iDays) +&#039; days.&#039;+#13+&#039;Do you want to visit a order page?&#039;, mtInformation, mbYes+mbNo, 0) = mrYes
         then OpenUrl(&#039;http://yourpage.com&#039;);

end;

begin
end.</code></pre></div><br /><p><strong>Download project:</strong><br /><a href="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=245&amp;download=1">http://myvisualdatabase.com/forum/misc. … download=1</a></p><br /><p><strong>Another project with serial number:</strong><br /><a href="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=1387&amp;download=1">http://myvisualdatabase.com/forum/misc. … download=1</a></p>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Wed, 20 May 2015 10:45:08 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=7801#p7801</guid>
		</item>
	</channel>
</rss>
