1. To create project template with custom parameter, please flow instruction of blow link



2. I need create classes naming with input value. For one class, it need change at least 3 places. 
For example, The new class base on ClassOldName.cs need named by using custom new value stored in $NewName$,
I  have changed below files:
   1) MyTemplate.vstemplate  
      <ProjectItem ReplaceParameters="true" TargetFileName="Class$NewName$.cs">ClassOldName.cs</ProjectItem>
   2)MyProject.csproj
      <Compile Include="Models\ Class$NewName$.cs " />
   3)ClassOldName.cs
     
namespace $safeprojectname$
{
    public class Class$WidgetName$
    {
     ...
    }
}
3.  Then build the wizard that implement IWizard with StrongName, and install it to GAC. 
For .net 4.0, the gacUtilit path is  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\

you need make sure you assembly can be install and uninstall correctly, and get correct PublicKeyToken
add  below in install.bat file, and run as administrator, 

path C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\

gacutil.exe -i CustomWizard.dll
pause
gacutil.exe -u "CustomWizard"
pause
the uninstall code will give result like this:

Assembly: CustomWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fbf8d46
e0d2fda8f, processorArchitecture=MSIL
Uninstalled: CustomWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fbf8
d46e0d2fda8f, processorArchitecture=MSIL
Number of assemblies uninstalled = 1
Number of failures = 0
Save the publicKeyToken, It will be used that later.

Then re-install the assemble to GAC again. by gacutil -i CustomWizard.dll, it will be ready to use.
to distribute your assembly to other machine, you had better add a setup project for it. in the file system, add "GAC" , then add project output in the GAC install list.


4. last step, add the WizardExtension section on the bottom between </templateContet> and </VSTemplate>

  </TemplateContent>
  <WizardExtension>
    <!--<Assembly>CustomWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=fa3902f409bb6a3b</Assembly>-->
    <Assembly>CustomWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=fbf8d46e0d2fda8f</Assembly>
    <FullClassName>CustomWizard.WidgetNameWizard</FullClassName>
</WizardExtension>
</VSTemplate>
if you didn't use the correct publicKeytoke, and just copy and past the code from the sample code, 
you will got error message when you use the template:
For more information on this problem and how to enable this templateplease see documentation on Customizing Project Templates



My sourcecode of CustomWizard
CustomWizard.rar (1.74 MB)