简体   繁体   English

在NSIS安装程序脚本中对Windows驱动器进行碎片整理?

[英]Defragmenting Windows Drives as part of an NSIS installer script?

I need to install a piece of software with a lot of files. 我需要安装包含大量文件的软件。 Our experience showed, that on highly fragmented hard drives that leads to very poor performance. 我们的经验表明,在高度分散的硬盘驱动器上会导致非常差的性能。 So I want to include automatic disk defragmentation into my installer (which I plan to write using NSIS). 因此,我想在安装程序中包括自动磁盘碎片整理(我打算使用NSIS编写)。 How can I include a defrag command and read the results as part of my installer? 如何包含碎片整理命令并在安装程序中读取结果?

I would integrate Jkdefrag ( http://kessels.biz/JkDefrag/ ) in the setup and run it with the command line options to defragment only the directory where you copied the files into. 我会将Jkdefrag( http://kessels.biz/JkDefrag/ )集成到安装程序中,然后使用命令行选项运行它,以仅对将文件复制到的目录进行碎片整理。

There are plenty of options and it is open source. 有很多选择,它是开源的。

NOTE: It uses the defragmentation API of MS, so it is as safe to use as any other defrag tool. 注意:它使用MS的碎片整理API,因此与其他任何碎片整理工具一样安全。 And you have the source if you need to adapt something or change the way the files are sorted. 如果您需要调整某些内容或更改文件的排序方式,则可以从中获得资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM