Visual Studio prerequisite - Advanced Installer Community

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!

jose.onrez
Posts: 8
Joined: Thu May 21, 2009 5:46 pm

Visual Studio prerequisite

Hi

I´m creating the installer for a visual studio AddIn, so i want to check that visual studio is already installed and need to copy some files to Visual Studio installation path, so i need to get the Visual Studion install path, there is a standar way for do that?

Regards,
José
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Visual Studio prerequisite

Hi,

You can try using registry searches for these registry entries:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir
If the values are found, they should contain the Visual Studio installation path. The properties of these searches can also be used for a custom launch condition to stop the installation if Visual Studio is not found.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jose.onrez
Posts: 8
Joined: Thu May 21, 2009 5:46 pm

Re: Visual Studio prerequisite

Hi Cosmin,

I create a registry search to know were visual studio templates are installed.

Code: Select all

[
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{57108857-CA30-464f-B3D1-375A345CE63C}\AddItemTemplates\TemplateDirs\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}\/1]
"SortPriority"=dword:00000014
"TemplatesDir"="C:\\Program Files\\Microsoft Visual Studio 9.0\\VC#\\.\\CSharpProjectItems"
So my search looks for the TemplateDir, i see two problems here:

1) if i choose type: "The value contains a path to a directory" the returned result is an empty string

2) if i choose type: "Retrieve the raw value" the result is returned ok, but when the installer try to use it as a directory path i get an error "The folder path '.' contains an invalid character."

Any ideas to get this working?

Regards,
José
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Visual Studio prerequisite

Hi,

This happens because the path contains a dot (".") which represents a folder, for example:

Code: Select all

C:\Program Files\Microsoft Visual Studio 9.0\VB\.\VBProjectItems
A solution is to retrieve the raw value and use a custom action to eliminate the dot from the path. For example, my sample path would become:

Code: Select all

C:\Program Files\Microsoft Visual Studio 9.0\VB\VBProjectItems
This new path can be stored in a custom property used as by a folder. Perhaps this thread will help you:
http://www.advancedinstaller.com/forums ... &sk=t&sd=a

It contains sample VBScript code for modifying a path.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jose.onrez
Posts: 8
Joined: Thu May 21, 2009 5:46 pm

Re: Visual Studio prerequisite

Hi,

I tryied what you say but i cannot get it working.

I added a new "attached custom action" to InstallExecuteSequence/CostFinalize , i have checked "Always Execute", "Imediate Action", "Synchronous Execution", the function name and action dataa are empty

my vs script contentes are this:

Code: Select all

Dim path
path = Session.Property("VS_90_CS_TEMPLATE_DIR")
Session.Property("VS_90_CS_TEMPLATE_DIR_MOD") = Replace(path, "\\.\\", "\\")
Then i added a new folder property based and choose New Property with the same name VS_90_CS_TEMPLATE_DIR_MOD and set default value to c:
and files are always installed to c: , seems likes the property is not being modified.

Not sure what i doing wrong.

Regards,
José
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Visual Studio prerequisite

Hi,

Please note that the custom action is executed too late to modify a folder path. Try scheduling at the beginning of the install, for example under "InstallUISequence" -> "AppSearch" and "InstallExecuteSequence" -> "AppSearch".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jose.onrez
Posts: 8
Joined: Thu May 21, 2009 5:46 pm

Re: Visual Studio prerequisite

Hi Cosmin,

After moved the custom action to after CostInitialize it is working, thanks for the help

Regards,
José

Return to “Common Problems”