NSISdl deletes file(s) when offline: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
(interwiki links)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{|align=right
{{PageAuthor|virtlink}}
|<small>Author: [[{{ns:2}}:virtlink|virtlink]] ([[{{ns:3}}:virtlink|talk]], [[{{ns:-1}}:Contributions/virtlink|contrib]])</small>
 
|}
<br style="clear:both;">
; Issue
; Issue
: When the NSISdl plugin must download a file, and there is no internet connection, the target file gets deleted if it already exists.
: When the [[NSISdl plugin]] must download a file, and there is no internet connection, the target file gets deleted if it already exists.


; Cause
; Cause
Line 10: Line 8:


; Solution
; Solution
: Use the Dialer plugin to check the internet connection.
: Use the [[Dialer plug-in]] to check the internet connection.


; Recommendation
; Recommendation
: You should download the file to a temporary directory (such as $PLUGINSDIR or $TEMP), and as soon as you've made sure that you've got the right file, and there were no errors, then you should copy it to its destination.
: You should download the file to a temporary directory (such as [[Reference/$PLUGINSDIR|$PLUGINSDIR]] or [[Reference/$TEMP|$TEMP]]), and as soon as you've made sure that you've got the right file, and there were no errors, then you should copy it to its destination.
 
[[Category:Minor Issues]]

Latest revision as of 10:33, 24 October 2016

Author: virtlink (talk, contrib)


Issue
When the NSISdl plugin must download a file, and there is no internet connection, the target file gets deleted if it already exists.
Cause
NSISdl deletes the target file if an error occurs, to prevent leaving any corrupted files.
Solution
Use the Dialer plug-in to check the internet connection.
Recommendation
You should download the file to a temporary directory (such as $PLUGINSDIR or $TEMP), and as soon as you've made sure that you've got the right file, and there were no errors, then you should copy it to its destination.