I am useing InstallShield Limited Edition for Visual Studio 2010 to create an installer, and I am trying to add an executable custom action.
My custom action in an exe that is installed to the install dir.
The custom action needs to use another file that is located in the install dir as well.
How do I get the path to the install dir to my exe? I tried to pess [INSTALLDIR] as an argument but it translates to "C:\Program" instead of the correct dir ("C:\Progam Files\MyCompany\MyProduct"). I tried [TARGETDIR] but it translate to E:\ (wrong as well).
Any Ideas?
Found the problem.
using [INSTALLDIR] is currect. the problem is with powershell. reading C:\Program Files...
as C:\Program.
the Issue is discussed here:
http://www.leeholmes.com/blog/2006/05/05/running-powershell-scripts-from-cmd-exe/
EXE custom actions are very limited. If I was using InstallShield LE, I'd create a C# WiX/DTF Custom Action and consume it in a WiX Merge Module and then consume that merge module in your InstallShield LE project. This gives you very powerful solution.
Related
I'm trying to figure out how to get a single-file generator installed on VS2010. Previously I got it sort-of working on VS2013 after many hours of head-banging; in both cases the primary difficulty is setting up the registry entries. Apparently VSIX files don't allow registry settings:
You can use the VSIX format to package project and item templates,
Visual Studio Integration Packages, Managed Extensibility Framework
(MEF) components, toolbox controls, assemblies, and custom types. The
VSIX format uses strictly file-based deployment and does not support
writing to the Global Assembly Cache (GAC), or to the system registry.
VSIX is the preferred deployment method for the extension types that
it supports.
My VS2013 solution involves the CodeGeneratorRegistrationAttribute and ComVisible(true) on the assembly, but after install, the extension doesn't work until the user runs devenv.exe /setup in Administrator mode. In VS2010, CodeGeneratorRegistrationAttribute does not exist in any of the SDK DLLs and simply adding the source code of CodeGeneratorRegistrationAttribute.cs to the project (as the Single File Generator sample does) doesn't seem to work (and I don't understand why the sample seems to expect it to work; .NET doesn't use structural typing, after all, so how could this attribute possibly have any effect?)
If a VSIX cannot add registry settings directly, I think a reasonable substitute is to include some code that automatically runs on VS startup. That code could find out the path of the registry hive of the running VS version and add the necessary registry settings at that time. So I have three questions:
How can I cause a method written by me, inside my extension, to run when VS starts?
How can I get the path of the current VS registry hive?
Is there any other way to add the registry information?
Eventually I gave up on making a VSIX to hold my single-file generator. I made a CodeProject article about what I did instead.
But back when I was still trying to make a VSIX file, this blog post came in handy.
What is wrong with MSI-deployment? You can do anything from there. WiX has option to install VSIX packages pretty simply, just use the embedded element <VSIXPackage>. It also offers you to create new registry keys + you get registry key unistall for free. Note that you can elevate privileges, if needed.
does your vsix have a class that extends Package?
Add code in your Package's Initialize method that runs when your package is initialized.
To get to VS based registry stuff, see Microsoft.VisualStudio.Shell.VSRegistry
How to add msxml6.msi as nested package into my vs 2005 setup (Based.msi) using Orca? I already used this instructions http://support.microsoft.com/kb/306439 , but msxml6.msi installation never started.
Nested installations are deprecated. You should either use a prerequisite, or a custom action.
Here is a small prerequisite tutorial for Visual Studio 2005: http://www.codeproject.com/KB/dotnet/Prerequisites_in_Setup.aspx
You can try using the bootstrapper manifest generator to configure your prerequisite.
If you want to use a custom action, you can either try launching msiexec.exe with the appropriate command line or write custom code which launches the MSI.
This custom action should be executed after InstallFinalize in InstallExecuteSequence table. It should also use the msidbCustomActionTypeAsync and msidbCustomActionTypeContinue flags.
I need to deploy a new item/project template and I found out that the way to do it is to copy it to [Visual Studio folder]\Common7\IDE\ItemTemplates.
How can I find where VS was installed (in my case VS2010)?
WiX code will be welcomed...
I suppose this is what you need.
Part of the answer:
You're going to need to query the registry to get the path - this is the relevant bit of the help from the wix site: http://wix.sourceforge.net/manual-wix3/read_a_registry_entry.htm
Most of the rest:
Path appears to be somewhere in HKCU (current user) - specifically a value here:
HKEY_CURRENT_USER\software\microsoft\visualstudio\10.0_Config which has a key InstallDir that should give you what you want (or close enough).
Not sure if you should be installing there or in the user's template directories but those are also in the registry (under 10.0 rather than 10.0_Config)
Trying to solve this problem.
I would like to learn how the bootstrapper detects if prerequisites (specifically .NET 3.5) are installed.
According to this reference, a way to detect if .NET is installed is to check the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
Using process monitor, I have inspected registry queries done by the bootstrapper (setup.exe) and it did not show any access to this registry key.
Does anybody know how the bootstrapper determines whether the prerequisites are installed on the target system?
Prerequisite packages for the msbuild GenerateBootStrapper packages are defined as XML files. The schema of those XML files is documented here. Take a look at the "InstallChecks" element to get an idea of what sort of checks are possible.
Curiously enough, I could not find such install checks in the prerequisite package for .NET 3.5. You can find this package in the windows SDK folder (C:\Program Files\Microsoft SDKs\Windows), along with the other predefined bootstrapper packages.
I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?
The Installer class can be used to configure items such as performance counters and message queues as part of the installation of your code. They can be included with any assembly and the most basic way to install components related to an assembly is to use InstallUtil yourassembly.dll which would contain your code and custom installers. It is good practice to provide an uninstall option for anything added in this manner.
See here fore more information http://msdn.microsoft.com/en-us/library/z3xc61bs(VS.80).aspx
I also use them to override behavior in the base installer class, such that I can run validations based on input in the MSI wizard, create files and folders, etc.
For Windows Services, I think they are required.
One thing I use an installer class is for NGEN (native images) which speed up startup. The installer class calls NGEN.exe to put it in the native images.
http://dotnetperls.com/Content/NGEN-Installer-Class.aspx