473,387 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Accessing Windows Installer Session

I have an executable that is launched by a custom action in the Windows
Installer. Is there a way to get access to the Session variables (Global
Properties)? Also how do I create a return code if there is a failure and I
want the install to abort?
Nov 21 '05 #1
4 3516
Hi,

Thanks for posting. The custom actions in VS.Net Setup Projects are all
"deferred custom actions". You can try passing the data into the custom
action with the "CustomActionData":

CustomActionData Property
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfcustomactiondataproperty.asp

The following walkthrough maybe useful to you:

Walkthrough: Passing Data to a Custom Action
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxwlkwalkthroughpassingdatatocustomaction.asp

In the walkthrough, the public property "EDITA1" is passed into the custom
action.

If you are work with an unmanaged (or managed) EXE file, you can also try
using the Arguments property for the custom action:

Arguments Property (Custom Actions)
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfargumentspropertycustomactions.asp

The usage of "Arguments" is similar to "CustomActionData" to pass the
properties.

To fail the installation in the custom action, you can try throwing an
Exception if it is an InstallerClass or return a non-zero value in the main
function for the EXE file.

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 21 '05 #2
I am developing this in InstallShield and the custom action calling the .NET
executable is "Execute Immediately" in the User Interface Sequence. If
vbscript can access the "Session" property there should be a way for me to do
this in the .NET executable.

How do I do this?

Thanks

"Felix Wang" wrote:
Hi,

Thanks for posting. The custom actions in VS.Net Setup Projects are all
"deferred custom actions". You can try passing the data into the custom
action with the "CustomActionData":

CustomActionData Property
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfcustomactiondataproperty.asp

The following walkthrough maybe useful to you:

Walkthrough: Passing Data to a Custom Action
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxwlkwalkthroughpassingdatatocustomaction.asp

In the walkthrough, the public property "EDITA1" is passed into the custom
action.

If you are work with an unmanaged (or managed) EXE file, you can also try
using the Arguments property for the custom action:

Arguments Property (Custom Actions)
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfargumentspropertycustomactions.asp

The usage of "Arguments" is similar to "CustomActionData" to pass the
properties.

To fail the installation in the custom action, you can try throwing an
Exception if it is an InstallerClass or return a non-zero value in the main
function for the EXE file.

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 21 '05 #3
I am developing this in InstallShield and the custom action calling the .NET
executable is "Execute Immediately" in the User Interface Sequence. If
vbscript can access the "Session" property there should be a way for me to do
this in the .NET executable.

How do I do this?

Thanks

"Felix Wang" wrote:
Hi,

Thanks for posting. The custom actions in VS.Net Setup Projects are all
"deferred custom actions". You can try passing the data into the custom
action with the "CustomActionData":

CustomActionData Property
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfcustomactiondataproperty.asp

The following walkthrough maybe useful to you:

Walkthrough: Passing Data to a Custom Action
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxwlkwalkthroughpassingdatatocustomaction.asp

In the walkthrough, the public property "EDITA1" is passed into the custom
action.

If you are work with an unmanaged (or managed) EXE file, you can also try
using the Arguments property for the custom action:

Arguments Property (Custom Actions)
http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxgrfargumentspropertycustomactions.asp

The usage of "Arguments" is similar to "CustomActionData" to pass the
properties.

To fail the installation in the custom action, you can try throwing an
Exception if it is an InstallerClass or return a non-zero value in the main
function for the EXE file.

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 21 '05 #4
Hi,

I don't think it is possible that we access the property directly with a
Net executable. There are some special support for VBScripts and JScripts
in Windows Installer engines. They are "native" custom actions.

Scripts
http://msdn.microsoft.com/library/de...us/msi/setup/s
cripts.asp?frame=true

One option that should also work for InstallShield is that we pass the
properties in as command line arguments for the executable.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JohnFol | last post by:
I am using the Win23 API WNetCancelConnection2 and can sucessfully make a connection to a share within my class. The class is called from a Windows Form based test harness. When I instantiate...
5
by: Niloday | last post by:
Hi All, I am trying to access a mapped network drive from a service that I have created. The service needs to create/delete folders/files on a network drive. When I tried to connect to a...
3
by: Bonj | last post by:
I need to write a windows service, and the only way it can access a shared drive on a file server on the network is if the installer is put in "User" mode - "LocalService", "LocalSystem" and...
3
by: Bonj | last post by:
I have a service which is a Windows Service, but it is running under a User account - I enter my own credentials on installing. It can access network files by specifying the full UNC path, i.e....
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
4
by: bob lambert | last post by:
Help I am trying to deploy to another pc a vb.net std 2002 windows form application. I am confused. I created a project - windows form I built form, compiled and debugged. I created a...
8
by: John | last post by:
Hi I have a set of classes (application framework) in the form of a dll that I have set to install in \ folder by default on the target user's pcs. This path can also be changed by the user when...
6
by: Tom E H | last post by:
My Python application includes some data files that need to be accessed by modules I distribute with it. Where can I put them, and how should I arrange my code, so that it works across...
9
by: =?Utf-8?B?THVpcyBBbnRvbmlvIFJvc2VsbG8gR2FyY2lh?= | last post by:
Hi, I have a big problem with a Visual C++ 6.0 function that retrives the logical drives and types in the local system. This function works perfectly on Windows 98, NT, 2000, XP and 2003, but I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.