473,587 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the location where user ask msi to install the application

Hi,

I want to get the location which user selects for installaion of
program using msi installer. I require this to do kind of cleanup
activity if something goes wrong with the installation.

Regards,
Vidisha
Jun 27 '08 #1
12 1753
That is [TARGETDIR].

"vi***********@ gmail.com" wrote:
Hi,

I want to get the location which user selects for installaion of
program using msi installer. I require this to do kind of cleanup
activity if something goes wrong with the installation.

Regards,
Vidisha
Jun 27 '08 #2
Yes I tries that thanks for answering However I want both /
SrcDir="[SourceDir]\" and /TrgDir="[TARGETDIR]\"

however when I give /SrcDir="[SourceDir]\" , /TrgDir="[TARGETDIR]\"
for my custom action it does not work. How can I get both.
Jun 27 '08 #3
/SrcDir="[SourceDir]\" /TrgDir="[TARGETDIR]\"

"vi***********@ gmail.com" wrote:
Yes I tries that thanks for answering However I want both /
SrcDir="[SourceDir]\" and /TrgDir="[TARGETDIR]\"

however when I give /SrcDir="[SourceDir]\" , /TrgDir="[TARGETDIR]\"
for my custom action it does not work. How can I get both.
Jun 27 '08 #4
Thanks that actually worked.

To confirm I want to ask I have to check some conditions from
SourceDir and if it fails then I have to rollback the installation.
However it looks like I have to write a program to delete the files
from TARGETDIR as it does not get deleted automatically.

Please confirm.
Jun 27 '08 #5
It sounds like, based on some condition within the source installation, you
want to uninstall after begining the install, via a custom action. To be
honest, I have never had need to do this intentionally. I have had occasion
where this occurs via an error being thrown in my custom action. Therefor, I
would recommend throwing an exception from your custom action code, such as
New Exception("You have a stolen source disk"). This install should then
"fail" more or less gracefully.

"vi***********@ gmail.com" wrote:
Thanks that actually worked.

To confirm I want to ask I have to check some conditions from
SourceDir and if it fails then I have to rollback the installation.
However it looks like I have to write a program to delete the files
from TARGETDIR as it does not get deleted automatically.

Please confirm.
Jun 27 '08 #6
Yes I do that
InstallExceptio n("Installer failed");

however files from the target directory do not get removed. So I have
to remove it by my program.

Do you recommed this.
Jun 27 '08 #7
Strange... My experience is the files got removed. I guess you will need to
do it manually in your code.

"vi***********@ gmail.com" wrote:
Yes I do that
InstallExceptio n("Installer failed");

however files from the target directory do not get removed. So I have
to remove it by my program.

Do you recommed this.
Jun 27 '08 #8
some of the files are used in the targetdir and therefore it is
throwing an exception and not leting me delete the files :(
Jun 27 '08 #9
Can you move your checks from the SourceDir to occur in the OnBeforeInstall
event? This is presuming you are doing it in the Commit event now.

"vi***********@ gmail.com" wrote:
some of the files are used in the targetdir and therefore it is
throwing an exception and not leting me delete the files :(
Jun 27 '08 #10

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

Similar topics

3
4271
by: ARobi | last post by:
I have developped an Access database with a lot of coding. The size of the database without data is about 5 meg. I am ready to copy the database to a client PC which already has a legal version of Access installed. 1.I am used to work with software such has C++ which basically save the program in many files but I notice that Access VBA save...
2
2436
by: Bill | last post by:
I have an Access 2003 database application that I split into an application component MDB file (i.e., forms, etc) and a data component MDB file (i.e., tables, etc.). I used the 2003 developer extensions Package Wizard program to create an installation package. (Note: I included the Access 2003 runtime because the users of my application...
14
5725
by: Keith | last post by:
I have an MDE application used by several hundred people in different parts of the world. The majority of users are of lesser experience computer experience. The app consists of a frontend (MDE) and backend (MDB), a help file and a key file. To this point, I have provided users with an installation package which installed both files into...
4
2118
by: JDS | last post by:
I am using a setup project and Windows Installer to deploy my application and have some additional code in custom actions. In this code I need to refer to one of the install files but I cannot find how to determine the path. For example, if the install CD is in the d: drive and the user runs d:\setup.exe I want to know that it has been run...
0
3287
by: coopdog | last post by:
This is a new issue as of an install to sp1 on vb express 2005. When I publish the application to my drive then I try to install it is wants to be installed from the same location as it was originally install. Any help would be great it is a real pain having to uninstall then install this update. Also all users are admins. Thanks Mike
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.