We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Apply template to Visual Studio setup project

Hi,

I have other components that correspond to SetUpMadeWith i.e.
<ROW Component="SetupMadeWith" ComponentId="{$guid3$}" Directory_="APPDIR" Attributes="4" KeyPath="SetupMadeWith"/>
These are for paths that are determined during the installation process. Do I need to give them dynamic guids too or can remain the same?

Thanks

David
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Re: Apply template to Visual Studio setup project

Hi
zeiddev wrote:I have other components that correspond to SetUpMadeWith i.e.

Code: Select all

<ROW Component="SetupMadeWith" ComponentId="{$guid3$}" Directory_="APPDIR" Attributes="4" KeyPath="SetupMadeWith"/>
These are for paths that are determined during the installation process. Do I need to give them dynamic guids too or can remain the same?
Theoretically, you must replace all GUID codes but keep in mind that you can use up to 10 unique GUIDs in your Visual Studio template.

If you have other questions, please let us know.
Teodor Micu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Apply template to Visual Studio setup project

Hello David,

Starting with Advanced Installer 10.9 in order to create custom Advanced Installer project template for Visual Studio you can proceed like this:
- open Advanced Installer application, create a desired installation project and save it with the following name: AIInstallProject.aip
- go to Visual Studio extensions folder (e.g. "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions") and copy on a temporary location the following archives

Code: Select all

Caphyon\Advanced Installer 10.9\ItemTemplates\AIProject\1033\AI_for_VS_Item_Template.zip
and

Code: Select all

Caphyon\Advanced Installer 10.9\ProjectTemplates\AIProject\1033\AI_for_VS_Project_Template.zip
- extract (in turn) the above archives from temporary location, replace the extracted "AIInstallProject.aip" file with your custom one and, then archive the extracted files into an archive with the same name
- replace in the Visual Studio extensions folder the original "AI_for_VS_Item_Template.zip" and "AI_for_VS_Project_Template.zip" archives with the modified ones

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Apply template to Visual Studio setup project

Hi,

I have just upgraded to Visual Studio 2017. I have the AI extension but I am struggling to move my custom template over to VS 2017. The structures where the extension is located have changed. Are you able to advise the new procedure?

Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Apply template to Visual Studio setup project

Hello David,

For Visual Studio 2017 you should create your extension project templates at the following paths:

Code: Select all

C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\15.0_<random guid>\Extensions\<random guid>\ProjectTemplates\AIProject\1033\AI_for_VS_Project_Template

Code: Select all

C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\15.0_<random guid>\Extensions\<random guid>\ItemTemplates\AIProject\1033\AI_for_VS_Item_Template
Can you please search for the above paths and let us know how this worked?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Apply template to Visual Studio setup project

When I go to this location I can see the existing project template in an unzipped folder called AI_for_VS_Project_Template (this is different from previous versions where the template was zipped up). I copied and unzipped my existing template into a folder within the 1033 folder so that I now how two folders in the 1033 folder; AI_for_VS_Project_Template and my template folder.

However when I go to create a new project I only see the existing AI template and not mine.

David
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Apply template to Visual Studio setup project

Hello David,

I apologize, my fault. I forgot to mention that you should overwrite the existing template files with your own. Also, there is no more need to archive the template files. So, you don't have to create a new folder for your template. Just copy your AIP at the above mentioned paths and edit the edit the "AI_for_VS_Project_Template.vstemplate" as explained in the past.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Apply template to Visual Studio setup project

Hi,

That seems to work, thank you. Does this mean though that it is not possible to have more than one template type. My template is very specific to a certain setup that we have and we would like to retain your default template too. Is this possible?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Apply template to Visual Studio setup project

Hello David,

This is doable, but you will have to manually edit our VS project template files like this:
1. go to "\ProjectTemplates" folder and copy/paste the "templateManifest1.1033.vstman" file
2. rename the .vstman file copy like this: "templateManifest2.1033.vstman" ; please keep in mind that each new copy of the .vstman file should have an increased number in its first part of the name (e.g. templateManifest2)
3. open with a text editor the "templateManifest2.1033.vstman" file
3.1. edit the "RelativePathOnDisk" XML element to point to the new VS project template like this:
<RelativePathOnDisk>AIProject\1033\My_New_VS_Project_Template</RelativePathOnDisk>
3.2. edit the "TemplateFileName" XML element to use the new .vstemplate file (you will create this in the next steps)
<TemplateFileName>My_New_VS_Project_Template.vstemplate</TemplateFileName>
3.3. edit the "Name" XML element to the new name of your setup project template
<Name>My New Advanced Installer Project</Name>
3.4. edit the "TemplateID" XML element to use a different ID, for instance:
<TemplateID>479ea42d-3d81-4f30-b3f9-6bb48dc3160F</TemplateID>
4. go to "\ProjectTemplates\AIProject\1033" folder and copy paste the existing "AI_for_VS_Project_Template" folder
5. rename the folder copy like this: "My_New_VS_Project_Template"
6. go to "My_New_VS_Project_Template" folder, delete the existing "AIInstallProject.aip" project file and add in place your own custom "AIInstallProject.aip" you want to be used as project template
7. rename the existing "AI_for_VS_Project_Template.vstemplate" file like this: "My_New_VS_Project_Template.vstemplate"
8. open with a text editor the "My_New_VS_Project_Template.vstemplate" file
8.1. edit the "Name" XML element to use the same name as the one defined in the .vstman file (i.e. "My New Advanced Installer Project")
<Name>My New Advanced Installer Project</Name>
8.2. edit the "TemplateID" XML element to the ID used in the .vstman file
<TemplateID>479ea42d-3d81-4f30-b3f9-6bb48dc3160F</TemplateID>
9. open Visual Studio 2017 and make sure the new project template works as expected

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zeiddev
Posts: 103
Joined: Sat Aug 10, 2013 12:30 am

Re: Apply template to Visual Studio setup project

That worked great. Thank you so much.

David
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Apply template to Visual Studio setup project

You're always welcome David.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”