i've got to install a java development package including some ant targets.
These ant targets have to be installed at %HOMEPATH%/.ant/lib.
my function looks that way
This function should be able to copy my files but it doesn't! I always get a write error while testing the install file.
;--------------------------------
; --- Installieren der Ant-Tasks
;
; Returnwerte:
; 0 für fehlerfreie Ausführung
; 1 für fehlende Umgebungsvariablen
;
; Aufruf:
; Call copyAntTasks
; Pop $R0
; IntCmp $R0 0 lbl_CopyAnt_OK
; ; Fehlerbehandlung
; lbl_CopyAnt_OK:
; ; Weiter
;
Function copyAntTasks
; Hole das Benutzer-Homeverzeichnis und breche bei Fehlern ab.
ClearErrors
ReadRegStr $R1 HKCU "Volatile Environment" "HOMEPATH"
IfErrors 0 lbl_environment_geholt
Push "1"
Goto lbl_copyAntTasks_ende
; lbl_environment_geholt:
; ; Ant-Homeverzeichnis prüfen und ggf. erstellen
; IfFileExists $R1\.ant lbl_antdir_exists
; CreateDirectory $R1\.ant
; lbl_antdir_exists:
; ; Ant-Libverzeichnis prüfen und ggf. erstellen
; IfFileExists $R1\.ant\lib lbl_antlib_exists
; CreateDirectory $R1\.ant\lib
lbl_antlib_exists:
; Ant-Tasks kopieren
SetOutPath $R1; C:\temp
File /r d:\install_jade\ant\*.*
; Exec '"COPY c:\temp\.ant %HOMEPATH%"'
Push "0"
lbl_copyAntTasks_ende:
FunctionEnd
As you can see, I tried to copy by a shell copy, too but this didn't work at all. A copy "by hand" works, HOMEPATH doesn't seem to be write protected.
Is it possible to set/unset a writ protection via nsis?
what am I doing wrong?