Clickonce, Date Installed

Clickonce, Date Installed

am 15.10.2007 19:22:03 von KillerCoder

I would like a Beta copy of my software to expire after seven days from
install. I use Clickonce for installing my applications.

How can I determine the install date of a Clickonce application.
--
Kenneth Lemieux
Project Engineer
Whelen Engineering Co., Inc.

Re: Clickonce, Date Installed

am 15.10.2007 20:09:34 von miro

Ken Lemieux wrote:
> I would like a Beta copy of my software to expire after seven days from
> install. I use Clickonce for installing my applications.
>
> How can I determine the install date of a Clickonce application.

You can try something simple, and on the first run write the date into
the my.settings value.

then just check the date to see when 7 days has elapsed.

An uninstall and re-install will clear this 7 days setting however.

Re: Clickonce, Date Installed

am 15.10.2007 20:29:02 von KillerCoder

Thanks Miro,

Your implementation is simple and straight forward. If I don't get any
responces much different from yours, then I will credit you for the responce.
--
Kenneth Lemieux
Project Engineer
Whelen Engineering Co., Inc.


"Miro" wrote:

> Ken Lemieux wrote:
> > I would like a Beta copy of my software to expire after seven days from
> > install. I use Clickonce for installing my applications.
> >
> > How can I determine the install date of a Clickonce application.
>
> You can try something simple, and on the first run write the date into
> the my.settings value.
>
> then just check the date to see when 7 days has elapsed.
>
> An uninstall and re-install will clear this 7 days setting however.
>

Re: Clickonce, Date Installed

am 16.10.2007 05:53:00 von miro

Ken Lemieux wrote:
> Thanks Miro,
>
> Your implementation is simple and straight forward. If I don't get any
> responces much different from yours, then I will credit you for the responce.

No need to credit.
Were all here helping eachother out for the greater good.

I come from a language where there is no newsgroup like this, so
learning .net for me and having access to give my 2 cents is a very nice
change.



I am posting below a question about my settings being lost on an update,
that I copied and pasted for reference. It might come of use to you as
well.

=====copied and pasted newsgroup=====
Bob Altman wrote:
> I've spent I-don't-know-how-long digging throught the documentation
trying to find an answer to what should be a pretty common question: If
I persist user settings via My.Settings, the settings get saved in a
file in a folder with a funky name. I can't find any documentation that
tells me how that name is constructed or what causes it to change.
>
> I'm concerned that I will make some change to my program and, when I
deploy it to users, they will lose their user settings because the
My.Settings magic will suddenly start looking in a different folder.
>
> Can someone point me at the relevant documentation for this subject?
Thanks a million!
>
> - Bob
>
You might like to have a look at -

http://msdn2.microsoft.com/en-us/library/ms379611(VS.80).asp x

About a third of the way down an explanation is supplied on how the
"funky name" is derived.

You're correct regarding your fears of Settings being lost when your app
is upgraded, however, good 'ol Microsoft have even provided an answer
for that. Simply use "My.Settings.Upgrade". (But it should only be used
once!).

I do the following in any code where I use My.Settings -

1. I add a User-Scoped Boolean entry called "SettingsValid" and set its
default value to FALSE.

2. I add this code to the beginning of my Form Load event -
If Not My.Settings.SettingsValid Then
My.Settings.Upgrade()
My.Settings.SettingsValid = True
My.Settings.Save()
End If


Hope this helps.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.

Re: Clickonce, Date Installed

am 16.10.2007 09:01:05 von jetan

Hi Kenneth,

I agree that using My.Setting is a good way to save the software
installation time since there is the .Net Framework build-in support.
Another way may be storing it in the registry, but this may require more
..Net registry writting permission than My.Setting.

The problem I wanted to point out is the security of this solution. Once
the end user knows about where your software My.Setting configure file is
stored, it is easy for him to modify your saved date in that file and
cheats your software from thinking it did not expire.

So, I would recommend you to use .Net crypto classes to encrypt the date
before saving. This will provide a basic protection for your solution.
Please refer to "System.Security.Cryptography" section in the article below
for basic information regarding .Net Cryptography:
http://msdn.microsoft.com/msdnmag/issues/06/00/SecurityBrief s/#S6

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx .
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Re: Clickonce, Date Installed

am 18.10.2007 05:19:35 von jetan

Hi Kenneth,

Have you reviewed the replies to you? Do they make sense to you? If you
still have any concern or need any help, please feel free to tell me,
thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx .
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.