Discussion:
[WiX-users] How to find out the installlocation from WiX Bootstrapper after installation?
patrickpirzer
2014-12-02 11:43:45 UTC
Permalink
Hello,

I have made a Bootstrapper-project in which i have defined an overridable
variable for the installocation of my application.
In the MsiPackage i have a hierarchy of subfolders under that
installlocation.
Here an example for better understanding:

<Fragment Id="MyFragment">
<Directory Id="TARGETDIR"
Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION"
Name="InstallLocation">
<Directory Id="CompanyFolder"
Name="MyCompany">
<Directory Id="INSTALLDIR"
Name="MyApp"/>
</Directory>
</Directory>
</Directory>

INSTALLLOCATION is either the ProgramFilesFolder or my given value (p.e.
"C:\MyApplication") and the setup files will be installed in the folder with
the name "MyApp".
What i need now, is to know the directorypath of MyApp, because i want to
execute a file, which lies in that directory, for creating a local database.
Can i get it from a WiX-variable or something like that?

Thanks in advance!
Patrick




--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-find-out-the-installlocation-from-WiX-Bootstrapper-after-installation-tp7598318.html
Sent from the wix-users mailing list archive at Nabble.com.
Nick Ramirez
2014-12-03 15:55:42 UTC
Permalink
You don't need to put an Id attribute on the Fragment, it won't be used.

The Id attributes of Directory elements are themselves, properties. You can
see the full path to your install directory be looking at the value of the
property called INSTALLDIR. You can see it in the MSI log:

msiexec /i myinstaller.msi /l*v install.txt

You can also save the value of this property to the registry, a file
somewhere, or some other place.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-find-out-the-installlocation-from-WiX-Bootstrapper-after-installation-tp7598318p7598357.html
Sent from the wix-users mailing list archive at Nabble.com.
patrickpirzer
2014-12-04 07:35:39 UTC
Permalink
Thank You Nick, but that's not exactly, what i need, because me and my
customers are using the EXE-file, which is generated by the build of the
bootstrapper-project.
Is there a chance to find the path of the final installfolder by - per
example - Bootstrapper.Engine.StringVariables[...]?
I have made a few minutes ago a test with
Bootstrapper.Engine.StringVariables["INSTALLDIR"] and that doesn't work,
because there is no variable with that name.

Goodbye and have a nice day!
Patrick




--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-find-out-the-installlocation-from-WiX-Bootstrapper-after-installation-tp7598318p7598385.html
Sent from the wix-users mailing list archive at Nabble.com.
Nick Ramirez
2014-12-04 12:36:00 UTC
Permalink
A bootstrapper is just a list of install packages that are installed one
after the other. So, if you had three install packages in the bootstrapper,
you wouldn't have one install directory, you would have three. For example,
if you bootstrapped SQL Server, the .NET framework and then your
application, they'll each go into their own install folder somewhere on the
machine.

If you want to find out where one of them went, you'll need to have that
particular installer save that information somewhere so that your
bootstrapper can find it. Like if you wanted to display your application's
install path to the user after everything has been installed, you could have
had the MSI write it to the registry and the bootstrapper (maybe it's
written in C#) can then read the registry to get it back. You would need to
detect when that package has been installed...or just wait until they've all
been installed, so that you know the registry has been written to.



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-find-out-the-installlocation-from-WiX-Bootstrapper-after-installation-tp7598318p7598389.html
Sent from the wix-users mailing list archive at Nabble.com.
patrickpirzer
2014-12-05 10:43:21 UTC
Permalink
Thanks a lot for Your explanations!
I have defined now a property in my GUI, which contains the complete
installfolder-path.
That's a little bit tricky but what shall You do?

Goodbye and have a nice day!
Patrick




--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-find-out-the-installlocation-from-WiX-Bootstrapper-after-installation-tp7598318p7598421.html
Sent from the wix-users mailing list archive at Nabble.com.

Loading...