Install on reboot: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with '{{PageAuthor|Afrow UK}} == Description == This macro can be used to install a file on reboot if the file is in use at time of installation. == Macro(s) == <highlight-nsis> !m…') |
m (→Usage) |
||
Line 34: | Line 34: | ||
</highlight-nsis> | </highlight-nsis> | ||
Stu | |||
[[Category:Disk, Path & File Functions]] | [[Category:Disk, Path & File Functions]] |
Revision as of 10:23, 22 July 2009
Author: Afrow UK (talk, contrib) |
Description
This macro can be used to install a file on reboot if the file is in use at time of installation.
Macro(s)
!macro InstallOnReboot Source Destination SetFileAttributes `${Destination}` NORMAL File `/oname=${Destination}.new` `${Source}` Delete /rebootok `${Destination}` Rename /rebootok `${Destination}.new` `${Destination}` !macroend !define InstallOnReboot `!insertmacro InstallOnReboot` !macro DeleteOnReboot Path IfFileExists `${Path}` 0 +3 SetFileAttributes `${Path}` NORMAL Delete /rebootok `${Path}` !macroend !define DeleteOnReboot `!insertmacro DeleteOnReboot`
Usage
${InstallOnReboot} some_file.exe $INSTDIR\some_locked_file.exe
${DeleteOnReboot} $INSTDIR\some_locked_file.exe
Stu