Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Expiration Date in Publish VS2005
 

Expiration Date in Publish VS2005

In publish VS 2005 process, we have to create a Certificate, and in that Certificate we have a expiration date. That attribute makes me confuse if the program is coming to the expiration date.
Can anyone give me advise on this thing?

If we create a new certificate, we will face a new problem that the old version dont have the same key with the new one --> the program can not start.
Huy TRAN.suetrek  Thursday, November 20, 2008 3:22 AM

Well, that's a different question altogether. What you really want to know how to do is extend your current [test] certificate. You have to create a new one with the same public key token.

There's an MSDN article telling how to write a program that will do this, but the Microsoft code doesn't work. Check out http://may.be/renewcert -- his code works.

This worked fine on one of my machines. On the other, it gave some error in the application event log about some C++ thing missing, so although I have VS2008 installed, I pulled the C++ redistributable from Microsoft.com and installed it, and it seemed to fix the problem. Just FYI.

He has an example of how to use it. You can create the new certficate, deploy your app with it, and the user will not have to uninstall and reinstall.

RobinS.

GoldMail.com

RobinDotNet  Thursday, November 20, 2008 9:12 AM

If you are using VS2005, there is no way around the "expiring certificate" problem. As you have noticed, VS creates a [test] certificate that expires in a year.

If you purchase a certificate, those usually expire in a year as well. (I think if you purchase them for longer, they cost substantially more.)

HOWEVER, there is a way to create a test certificate that lasts whatever time period you want it to, say 5 years.

To do this, you need to track down MakeCert.exe. This is in the WIndows SDKs folder down a few levels under \bin\.

You need to bring up a command window and drill down to that folder, and run MakeCert. If you just type in MakeCert, it will give you a list of options. Here's an example:

Makecert -sv TestOct7.pvk -n "CN=TestOct07" TestOct7.cer -b 10/06/2008 -e 10/08/2013

This will make a certificate that expires at midnight on 10/8/2013.

Now you need to make a pfx file that you can use in Visual Studio. This uses pvk2pfx.exe, also in that bin folder.

pvk2pfx -pvk TestOct7.pvk -spc TestOct7.cer -pfx TestOct7.pfx -po mykeygoeshere

Then in Visual Studio under the Signing tab, choose "select a file" and go find that file and use it to sign your deployment.

If you are using (or are going to use) VS2008, and you are targeting the .Net 3.5 Framework (and deploying it as a prerequisite), you don't need to do this. You can sign it with a different certificate in a year, and it will not require the user to uninstall and reinstall.

You can also use VS2008 and target .Net 2.0 if all of your customers use Windows XP and have all of the service packs installed.

If you use VS2008 and target .Net 2.0, your Vista users will have to uninstall and reinstall. This is because the problem is fixed in .Net 2.0 SP-1 and .Net 3.5, and Vista users (with .net 3.0 by default) will not get the .Net 2.0 SP-1 as a winodws update, and they can not install it. There are details about that in my post that one of the pinned posts at the top of this forum.

RobinS.

GoldMail.com

RobinDotNet  Thursday, November 20, 2008 7:07 AM
That's so interesting!

I have created a certificate that has 10 years Smile .
And can you help me one more time? How can I merge the version that already has 1 year (expiration date) with version 10 years.

Basicly, I will uninstall the old version and then install the new version (with key 10 years).
and I have read and adjusted the magnifest file between 2 version. But it doesnt work!

Can you give me another solution without uninstall the old version.

I am not builder, so I have to be a builder Sad

Thanks for your feedback!

Huy TRAN
Huy TRAN.suetrek  Thursday, November 20, 2008 8:40 AM

Well, that's a different question altogether. What you really want to know how to do is extend your current [test] certificate. You have to create a new one with the same public key token.

There's an MSDN article telling how to write a program that will do this, but the Microsoft code doesn't work. Check out http://may.be/renewcert -- his code works.

This worked fine on one of my machines. On the other, it gave some error in the application event log about some C++ thing missing, so although I have VS2008 installed, I pulled the C++ redistributable from Microsoft.com and installed it, and it seemed to fix the problem. Just FYI.

He has an example of how to use it. You can create the new certficate, deploy your app with it, and the user will not have to uninstall and reinstall.

RobinS.

GoldMail.com

RobinDotNet  Thursday, November 20, 2008 9:12 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce & product description
• Register or demo mode
• Problem with Manifest File???
• Copying files to client machine when installing EXE using ClickOnce
• Error on install with excel version...global assembly cache issue on users computer
• problem deploying obfuscated app using ClickOnce
• Embedding manifest in MSI using Visual Studio 2003
• Setup project includes .NET Framework 3.5 dependency
• validating hardware requirements
• How to Install WebService more than once using websetup?