Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 05-22-2008   #1 (permalink)
vidishasharma


 
 

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

My System SpecsSystem Spec
Old 05-22-2008   #2 (permalink)
Family Tree Mike


 
 

RE: How to get the location where user ask msi to install the applicat

That is [TARGETDIR].

"vidishasharma@xxxxxx" wrote:
Quote:

> 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
>
My System SpecsSystem Spec
Old 05-22-2008   #3 (permalink)
vidishasharma


 
 

Re: How to get the location where user ask msi to install theapplicat

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.
My System SpecsSystem Spec
Old 05-22-2008   #4 (permalink)
Family Tree Mike


 
 

Re: How to get the location where user ask msi to install the appl

/SrcDir="[SourceDir]\" /TrgDir="[TARGETDIR]\"

"vidishasharma@xxxxxx" wrote:
Quote:

> 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.
>
My System SpecsSystem Spec
Old 05-22-2008   #5 (permalink)
vidishasharma


 
 

Re: How to get the location where user ask msi to install the appl

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.
My System SpecsSystem Spec
Old 05-22-2008   #6 (permalink)
Family Tree Mike


 
 

Re: How to get the location where user ask msi to install the appl

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.

"vidishasharma@xxxxxx" wrote:
Quote:

> 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.
>
My System SpecsSystem Spec
Old 05-22-2008   #7 (permalink)
vidishasharma


 
 

Re: How to get the location where user ask msi to install the appl

Yes I do that
InstallException("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.
My System SpecsSystem Spec
Old 05-22-2008   #8 (permalink)
Family Tree Mike


 
 

Re: How to get the location where user ask msi to install the appl

Strange... My experience is the files got removed. I guess you will need to
do it manually in your code.

"vidishasharma@xxxxxx" wrote:
Quote:

> Yes I do that
> InstallException("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.
>
My System SpecsSystem Spec
Old 05-22-2008   #9 (permalink)
vidishasharma


 
 

Re: How to get the location where user ask msi to install the appl

some of the files are used in the targetdir and therefore it is
throwing an exception and not leting me delete the files
My System SpecsSystem Spec
Old 05-22-2008   #10 (permalink)
Family Tree Mike


 
 

Re: How to get the location where user ask msi to install the appl

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.

"vidishasharma@xxxxxx" wrote:
Quote:

> some of the files are used in the targetdir and therefore it is
> throwing an exception and not leting me delete the files
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
User Documents - New location? Vista General
set application window location? Vista General
Install application as standard user Vista security
Changing the location of the user account Vista General
User temp files location Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46