[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.setup

How to get the CD drive letter for a setup project

Victor Reboucas

6/8/2006 10:24:00 PM

Hi, I'm trying to find out a way to get the CD drive from wich my setup is
being run.

Let's say if the user runs the setup from the local computer (c:\docs and
setts\user name\desktop\) I would like to retreive "C:\" or "D:\" from the
CD, etc.

Is there any way to do this?

PS: I'm trying using Environment.CurrentDirectory but (at least during
setup) it points to c:\windows\system32\, not to the CD drive setup file

PS2: I'm using VS.Net 2003 + .Net Framework 1.1


thanks for any clue,
regards,
Victor


6 Answers

Phil Wilson

6/9/2006 3:17:00 PM

0

What's the context here? Are talking about code running as a custom action
called from your MSI setup? Something else?

--
Phil Wilson
[Microsoft MVP-Windows Installer]
"VR" <vcreb@hotmail.com> wrote in message
news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
> Hi, I'm trying to find out a way to get the CD drive from wich my setup is
> being run.
>
> Let's say if the user runs the setup from the local computer (c:\docs and
> setts\user name\desktop\) I would like to retreive "C:\" or "D:\" from the
> CD, etc.
>
> Is there any way to do this?
>
> PS: I'm trying using Environment.CurrentDirectory but (at least during
> setup) it points to c:\windows\system32\, not to the CD drive setup file
>
> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>
>
> thanks for any clue,
> regards,
> Victor
>


Victor Reboucas

6/9/2006 3:48:00 PM

0

Oh, sorry, that's the exact context: a code running as a custom action
called from a MSI setup.

thanks
regards
Victor



"Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
news:eeDD%23d9iGHA.2220@TK2MSFTNGP05.phx.gbl...
> What's the context here? Are talking about code running as a custom action
> called from your MSI setup? Something else?
>
> --
> Phil Wilson
> [Microsoft MVP-Windows Installer]
> "VR" <vcreb@hotmail.com> wrote in message
> news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
>> Hi, I'm trying to find out a way to get the CD drive from wich my setup
>> is being run.
>>
>> Let's say if the user runs the setup from the local computer (c:\docs and
>> setts\user name\desktop\) I would like to retreive "C:\" or "D:\" from
>> the CD, etc.
>>
>> Is there any way to do this?
>>
>> PS: I'm trying using Environment.CurrentDirectory but (at least during
>> setup) it points to c:\windows\system32\, not to the CD drive setup file
>>
>> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>>
>>
>> thanks for any clue,
>> regards,
>> Victor
>>
>
>


Victor Reboucas

6/9/2006 6:59:00 PM

0

During my research I found a MSI method named MsiGetSourcePath, but all the
code samples where written in C++ (I'm a Vb.Net developer).

So, is there any way to reference the current installer from my custom
action to read this property?


thanks a lot,
regards,
Victor


"Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
news:eeDD%23d9iGHA.2220@TK2MSFTNGP05.phx.gbl...
> What's the context here? Are talking about code running as a custom action
> called from your MSI setup? Something else?
>
> --
> Phil Wilson
> [Microsoft MVP-Windows Installer]
> "VR" <vcreb@hotmail.com> wrote in message
> news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
>> Hi, I'm trying to find out a way to get the CD drive from wich my setup
>> is being run.
>>
>> Let's say if the user runs the setup from the local computer (c:\docs and
>> setts\user name\desktop\) I would like to retreive "C:\" or "D:\" from
>> the CD, etc.
>>
>> Is there any way to do this?
>>
>> PS: I'm trying using Environment.CurrentDirectory but (at least during
>> setup) it points to c:\windows\system32\, not to the CD drive setup file
>>
>> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>>
>>
>> thanks for any clue,
>> regards,
>> Victor
>>
>
>


Phil Wilson

6/10/2006 6:23:00 PM

0

There's a couple of ways to get the location of the current install. The
OriginalDatabase property (case-sensitive) is the path to the installing MSI
file, so you could pass that into a custom action, and parse it to get the
drive letter. SourceDir is similar, returning the directory.

--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.ht...

"VR" <vcreb@hotmail.com> wrote in message
news:uazTne$iGHA.3496@TK2MSFTNGP04.phx.gbl...
> During my research I found a MSI method named MsiGetSourcePath, but all
> the code samples where written in C++ (I'm a Vb.Net developer).
>
> So, is there any way to reference the current installer from my custom
> action to read this property?
>
>
> thanks a lot,
> regards,
> Victor
>
>
> "Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
> news:eeDD%23d9iGHA.2220@TK2MSFTNGP05.phx.gbl...
>> What's the context here? Are talking about code running as a custom
>> action called from your MSI setup? Something else?
>>
>> --
>> Phil Wilson
>> [Microsoft MVP-Windows Installer]
>> "VR" <vcreb@hotmail.com> wrote in message
>> news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
>>> Hi, I'm trying to find out a way to get the CD drive from wich my setup
>>> is being run.
>>>
>>> Let's say if the user runs the setup from the local computer (c:\docs
>>> and setts\user name\desktop\) I would like to retreive "C:\" or "D:\"
>>> from the CD, etc.
>>>
>>> Is there any way to do this?
>>>
>>> PS: I'm trying using Environment.CurrentDirectory but (at least during
>>> setup) it points to c:\windows\system32\, not to the CD drive setup file
>>>
>>> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>>>
>>>
>>> thanks for any clue,
>>> regards,
>>> Victor
>>>
>>
>>
>
>


Victor Reboucas

6/10/2006 9:10:00 PM

0

Hi Phil, thanks a lot for your answer.

Reading your answer I got a bit confused about how to deal with MSI
properties in a .Net setup, that is, can I use this approach with any MSI
property?

Well, thanks a lot again,
regards,
Victor




"Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
news:ur9P0qLjGHA.4044@TK2MSFTNGP03.phx.gbl...
> There's a couple of ways to get the location of the current install. The
> OriginalDatabase property (case-sensitive) is the path to the installing
> MSI file, so you could pass that into a custom action, and parse it to get
> the drive letter. SourceDir is similar, returning the directory.
>
> --
> Phil Wilson
> [Microsoft MVP-Windows Installer]
> Definitive Guide to Windows Installer
> http://apress.com/book/bookDisplay.ht...
>
> "VR" <vcreb@hotmail.com> wrote in message
> news:uazTne$iGHA.3496@TK2MSFTNGP04.phx.gbl...
>> During my research I found a MSI method named MsiGetSourcePath, but all
>> the code samples where written in C++ (I'm a Vb.Net developer).
>>
>> So, is there any way to reference the current installer from my custom
>> action to read this property?
>>
>>
>> thanks a lot,
>> regards,
>> Victor
>>
>>
>> "Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
>> news:eeDD%23d9iGHA.2220@TK2MSFTNGP05.phx.gbl...
>>> What's the context here? Are talking about code running as a custom
>>> action called from your MSI setup? Something else?
>>>
>>> --
>>> Phil Wilson
>>> [Microsoft MVP-Windows Installer]
>>> "VR" <vcreb@hotmail.com> wrote in message
>>> news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
>>>> Hi, I'm trying to find out a way to get the CD drive from wich my setup
>>>> is being run.
>>>>
>>>> Let's say if the user runs the setup from the local computer (c:\docs
>>>> and setts\user name\desktop\) I would like to retreive "C:\" or "D:\"
>>>> from the CD, etc.
>>>>
>>>> Is there any way to do this?
>>>>
>>>> PS: I'm trying using Environment.CurrentDirectory but (at least during
>>>> setup) it points to c:\windows\system32\, not to the CD drive setup
>>>> file
>>>>
>>>> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>>>>
>>>>
>>>> thanks for any clue,
>>>> regards,
>>>> Victor
>>>>
>>>
>>>
>>
>>
>
>


Phil Wilson

6/11/2006 6:40:00 PM

0

Yes you can.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
"VR" <vcreb@hotmail.com> wrote in message
news:O5%23UyMNjGHA.3440@TK2MSFTNGP02.phx.gbl...
> Hi Phil, thanks a lot for your answer.
>
> Reading your answer I got a bit confused about how to deal with MSI
> properties in a .Net setup, that is, can I use this approach with any MSI
> property?
>
> Well, thanks a lot again,
> regards,
> Victor
>
>
>
>
> "Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
> news:ur9P0qLjGHA.4044@TK2MSFTNGP03.phx.gbl...
>> There's a couple of ways to get the location of the current install. The
>> OriginalDatabase property (case-sensitive) is the path to the installing
>> MSI file, so you could pass that into a custom action, and parse it to
>> get the drive letter. SourceDir is similar, returning the directory.
>>
>> --
>> Phil Wilson
>> [Microsoft MVP-Windows Installer]
>> Definitive Guide to Windows Installer
>> http://apress.com/book/bookDisplay.ht...
>>
>> "VR" <vcreb@hotmail.com> wrote in message
>> news:uazTne$iGHA.3496@TK2MSFTNGP04.phx.gbl...
>>> During my research I found a MSI method named MsiGetSourcePath, but all
>>> the code samples where written in C++ (I'm a Vb.Net developer).
>>>
>>> So, is there any way to reference the current installer from my custom
>>> action to read this property?
>>>
>>>
>>> thanks a lot,
>>> regards,
>>> Victor
>>>
>>>
>>> "Phil Wilson" <pdjwilson@nospam.cox.net> wrote in message
>>> news:eeDD%23d9iGHA.2220@TK2MSFTNGP05.phx.gbl...
>>>> What's the context here? Are talking about code running as a custom
>>>> action called from your MSI setup? Something else?
>>>>
>>>> --
>>>> Phil Wilson
>>>> [Microsoft MVP-Windows Installer]
>>>> "VR" <vcreb@hotmail.com> wrote in message
>>>> news:%23JAews0iGHA.4344@TK2MSFTNGP05.phx.gbl...
>>>>> Hi, I'm trying to find out a way to get the CD drive from wich my
>>>>> setup is being run.
>>>>>
>>>>> Let's say if the user runs the setup from the local computer (c:\docs
>>>>> and setts\user name\desktop\) I would like to retreive "C:\" or "D:\"
>>>>> from the CD, etc.
>>>>>
>>>>> Is there any way to do this?
>>>>>
>>>>> PS: I'm trying using Environment.CurrentDirectory but (at least during
>>>>> setup) it points to c:\windows\system32\, not to the CD drive setup
>>>>> file
>>>>>
>>>>> PS2: I'm using VS.Net 2003 + .Net Framework 1.1
>>>>>
>>>>>
>>>>> thanks for any clue,
>>>>> regards,
>>>>> Victor
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>