473,394 Members | 1,935 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,394 software developers and data experts.

How to determine the location of install files

JDS
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 from d: (rather than e: or any other location) so that I can build
up the path to one of the folders on the CD.

I do not want to copy the file as part of the installation because it
is large and not required once installation is complete.

Can anyone help?
Dec 15 '07 #1
4 2111


"JDS" wrote:
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 from d: (rather than e: or any other location) so that I can build
up the path to one of the folders on the CD.

I do not want to copy the file as part of the installation because it
is large and not required once installation is complete.

Can anyone help?
If you select the action to install your application and look at the
properties of it you can see the following property: CustomActionData Here
you type:/INSTALLDIR="[TARGETDIR]". In your installer class you can get the
parameter: Context.Parameters.Item("TARGETDIR"). This is how I find files in
the target directory. I believe the SOURCEDIR is what you want.
Dec 15 '07 #2
JDS
On 16 Dec, 12:52, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Is your custom code (DLL) referenced within the install and commit phases?
Even if you don't do an "install" action, but just a "commit" as I usually
do, you need to do this. I got similar errors. I got errors during both
types of installs though.

I suspect then that when repairing, it does something slightly different
than when installing. I don't have any of my install projects here at home.
I will try to diagnose from my office computer at the next opportunity.- Hide quoted text -

- Show quoted text -
Yes, I only have code for commit. However, I tried adding a reference
to the install and still the same error on repair.

I have a form in my class (frmPostInstall) and all I have done in the
install action is to declare a new dummy form and then set it to
Nothing as follows:

Public Overrides Sub Install(ByVal stateSaver As
System.Collections.IDictionary)
Dim DummyForm As New frmPostInstall
Try
MyBase.Install(stateSaver)
DummyForm = Nothing
Catch ex As Exception
MsgBox("Custom action error on install: " & ex.Message)
End Try
End Sub

I don't know if this should be sufficient.

Thanks for your help.
Dec 16 '07 #3


"JDS" wrote:
On 16 Dec, 12:52, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Is your custom code (DLL) referenced within the install and commit phases?
Even if you don't do an "install" action, but just a "commit" as I usually
do, you need to do this. I got similar errors. I got errors during both
types of installs though.

I suspect then that when repairing, it does something slightly different
than when installing. I don't have any of my install projects here at home.
I will try to diagnose from my office computer at the next opportunity.- Hide quoted text -

- Show quoted text -

Yes, I only have code for commit. However, I tried adding a reference
to the install and still the same error on repair.

I have a form in my class (frmPostInstall) and all I have done in the
install action is to declare a new dummy form and then set it to
Nothing as follows:

Public Overrides Sub Install(ByVal stateSaver As
System.Collections.IDictionary)
Dim DummyForm As New frmPostInstall
Try
MyBase.Install(stateSaver)
DummyForm = Nothing
Catch ex As Exception
MsgBox("Custom action error on install: " & ex.Message)
End Try
End Sub

I don't know if this should be sufficient.

Thanks for your help.
Bummer...

I got to work and tested a solution similar to what we are discussing, and
get the same error that you describe when I run the repair mode on my app. I
thought I had mine running. I will continue working this and if I find
anything, post back here. There must be some easy fix to this, you would
think...
Dec 17 '07 #4
JDS
On 17 Dec, 14:32, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Bummer...

I got to work and tested a solution similar to what we are discussing, and
get the same error that you describe when I run the repair mode on my app. I
thought I had mine running. I will continue working this and if I find
anything, post back here. There must be some easy fix to this, you would
think...- Hide quoted text -

- Show quoted text -
Yes, you'd think ....

Thanks for having a look at this. Don't worry about progressing on my
account as the repair option is not really going to be that useful on
my app anyway and I will just include instructions to remove first if
it ever comes to that. However, it seems frustrating that it behaves
this way and I'm sure it will help someone else if there was an
answer.

Thanks again for your help.
Dec 18 '07 #5

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

Similar topics

1
by: Allan Cammish | last post by:
I am writing a web based application that uses an ActiveX control on a web page to install files on the user's computer. These files will then be opened using programs on the user's computer such...
1
by: Andork | last post by:
Can anyone tell me how to dirrect the IIS installation to an other drive or how to manually move all related files to an other drive? I think I can menage the sites, but NNTP and SMTP I can't see...
3
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of...
1
by: ImageAnalyst | last post by:
In my setup/installer for my solution, I get several warnings: Warning 16 Two or more objects have the same target location ('\interop.shell32.dll') Warning 18 Two or more objects have the same...
2
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...
8
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the...
1
by: phrankbooth | last post by:
Hi, New to windows services, but I've managed to create one and install it successfully. However, I'm confused about what the InstallUtil actually does. I'm not sure if it just registers and...
14
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)...
12
by: vidishasharma | last post by:
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. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.