|
|
#1 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
Save File dialog
Hi,
I have created a custom installer. On the installer main page, i have a save button. On click of this button. I want to open a Save File dialog, that will save the licence.rtf file. how to do this. Thanx. |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
if you are using nsDialogs, just add an ${NSD_OnClick} event to that button, and in the function called by that event, call the nsDialogs::SelectFileDialog function specifying the mode as 'save'.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
Thanx for the reply. I have file $LICENCE. So when I am doing
nsDialogs::SelectFileDialog /NOUNLOAD save $LICENSE "*.txt" it is not saving it. Am i doing something wrong? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
What exactly i want is I have displayed License in the nsis installer screen. I have a save button on the installer, so when the user clicks on save button, it should save the license on the user system.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
I tried this way
nsDialogs::SelectFileDialog /NOUNLOAD "save" $PLUGINSDIR\license.rtf "*.txt" It is opening save file dialog with my file name and save as type "*.txt". But when I am clicking save, it is not actually saving it on the system. |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
I tried this way
nsDialogs::SelectFileDialog /NOUNLOAD "save" $PLUGINSDIR\license.rtf "*.txt" It is opening save file dialog with my file name and save as type "*.txt". But when I am clicking save, it is not actually saving it on the system. |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
any recent version of nsDialogs doesn't require /NOUNLOAD - not sure if it ever did
![]() You may also wish to put quotation marks around your $license if that is the variable being used for the default location on the user's computer to save the file to. code: |
|
|
|
|
|
#8 | |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
To actually save the file, you'd need to add a GetParent (from FileFunc.nsh) and File combination or maybe use CopyFiles - presuming your license text file is already in the PLUGINSDIR anyway: code: |
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2009
Posts: 12
|
Thanx..it is working that way. But if the file is already at the location where I am trying to save, it overwrites it without prompting any message. is there any way we can handle it. i mean if file is already there, then it should prompt message to overwrite it.
|
|
|
|
|
|
#10 | |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
code: This checks if the path was empty (user canceled), in which case all the code is skipped. This checks if the path already exists, in which case the installers asks the user if they want to overwrite, first. If they do not want to overwrite (the default), the user is prompted for a new path by going back to the beginning of the code. If the path does not already exist, or the user chooses to overwrite, it will continue with the CopyFiles code as before. |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|