|
|
#1 |
|
Junior Member
Join Date: Feb 2012
Posts: 3
|
Hi,
Using NSIS I have made an installer that lets the user browse to their USB drive and installs my files/folders on the USB's root directory. But I want to go a step further and instead of the user having to format their USB drive manually beforehand, I want my installer to format it for them. That is my installer will format the USB drive and then put my files/folders on the USB drive. I would like to know how do I go about doing this and links to any references will be greatly appreciated. Thanks. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
I'm guessing you would have to call SHFormatDrive or FormatEx ( http://www.ureader.com/msg/1474253.aspx http://forum.sysinternals.com/create...338_page4.html ftp://ftp.decus.org/decus/vms/sig_ta...b/nt/fmifs.htm ) or IOCTL_DISK_SET_DRIVE_LAYOUT with the system plugin or use WMI ( http://msdn.microsoft.com/en-us/libr...2#Win32_Volume )
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2012
Posts: 3
|
Thnx Anders, will look more into it.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
You can format at the command line, too:
The "echo. |" sends an Enter key to the prompt it asks.code: |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
demiller9: If by prompt you mean entering the volume label, you can use /V:label to enter it as a commandline parameter.
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
MSG: the prompt is "Insert new disk for drive X: and press ENTER when ready" (a chance to *not* format the wrong drive). I already have the /V switch.
|
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Feb 2012
Posts: 3
|
Quote:
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|