Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th July 2003, 20:14   #1
JWTEUNISSE
Junior Member
 
Join Date: Jul 2003
Location: Amersfoort
Posts: 4
Arrow how to check if the disk on which to install the software exists

For a small piece of software and some data files I have to check first if the target disk (D exists. If not, then install the software on the c: disk.

Is there any way to perform this?
I have tried ifileexist, but I get compile errors.
Searching the discussion I couldnot find a solution.

Please help?
Thanks.
JWTEUNISSE is offline   Reply With Quote
Old 30th July 2003, 20:27   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Does the software wrote registry keys or
have a pre-defined installation path?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 31st July 2003, 10:28   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Firstly you can check if the D or C drives exist first like so:
code:
IfFileExists "D:\" +2
MessageBox MB_OK "D: drive does not exist" ID_OK done1

## place search !insertmacro here ##

done1:
IfFileExists "C:\" +2
MessageBox MB_OK "C: drive does not exist" ID_OK done2

## place search !insertmacro here ##

done2:



The search function is here:
http://nsis.sourceforge.net/archive/...ances=0,11,211

-Stu
Afrow UK is offline   Reply With Quote
Old 31st July 2003, 14:44   #4
JWTEUNISSE
Junior Member
 
Join Date: Jul 2003
Location: Amersfoort
Posts: 4
Thanks for your reply.

First the software does not write registry keys. The goal is to do a silent install. When for the first time we do an install the installer checks 1) for the D: disk and if not present uses the C: disk.


The second or the next time an update of the usersoftware is needed, we do the same check. The installation directories have always the same name and structure.

Does this help to use the proposed solution.?

regards, jan willem
JWTEUNISSE is offline   Reply With Quote
Old 31st July 2003, 15:13   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use my example.

It may need modifying.
I would modify it for you but my thinking head is still asleep at the moment

-Stu
Afrow UK is offline   Reply With Quote
Old 31st July 2003, 20:33   #6
JWTEUNISSE
Junior Member
 
Join Date: Jul 2003
Location: Amersfoort
Posts: 4
Stu, I would be much obliged, if you could modify it.

Thanks in advance
jan willem
JWTEUNISSE is offline   Reply With Quote
Old 31st July 2003, 20:44   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ok, I have my mind in gear a bit more now lol
No need for search functio nat all.
code:

IfFileExists "D:\" 0 install_on_c
DetailPrint "Installing software to D: drive"

## place files here ##

Goto done
install_on_c:
DetailPrint "Installing software to C: drive"

## place files here ##

done:



-Stu
Afrow UK is offline   Reply With Quote
Old 1st August 2003, 09:56   #8
JWTEUNISSE
Junior Member
 
Join Date: Jul 2003
Location: Amersfoort
Posts: 4
Many thanks Stu,
With a small modification, this works OK.

The IfFileExists needs a *.* to check for the D: disk.

code:--------------------------------------------------------------------------------
IfFileExists "D:\*.*" 0 install_on_c
DetailPrint "Installing software to D: drive"

## place files here ##

Goto done
install_on_c:
DetailPrint "Installing software to C: drive"

## place files here ##

done:
--------------------------------------------------------------------------------
JWTEUNISSE is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump