惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
Recorded Future
Recorded Future
S
Schneier on Security
I
InfoQ
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
O
OpenAI News
W
WeLiveSecurity
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
人人都是产品经理
人人都是产品经理
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
The Hacker News
The Hacker News
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
NISL@THU
NISL@THU
T
Tailwind CSS Blog
V
Visual Studio Blog
PCI Perspectives
PCI Perspectives
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
D
DataBreaches.Net
B
Blog RSS Feed
N
News and Events Feed by Topic
N
News and Events Feed by Topic
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
Latest news
Latest news
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
V
V2EX
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
Help Net Security
Help Net Security

博客园 - 撬棍

【.Net】2、8、16进制转换 【.Net】执行CMD命令 【.Net】获取随机数函数 【.Net】注册程序开机启动 【.Net】把窗体“钉”到桌面上 【.Net】多语言查看MSDN 【.Net】 显示星期字符串 【.Net】 判断时间字符串正确性 【.Net】 实现窗口拖动 【.Net】 Winform 单例运行实例 [C++]函数返回值 [C++]数组参数 [C++]const的指针使用 [C++]指针类型出参 [VBA]Excel输出utf-8编码格式文件 使用WideCharToMultiByte 【C++】split [C语言学习]之打印万年历 - 撬棍 - 博客园 [VB6.0]让程序在任务列表和资源管理器“隐身” [VB]修改注册表让程序开机自动运行 - 撬棍 - 博客园
[InstallShield]FindAllFiles与SetFileInfo配合实现文件加多文件属性设置
撬棍 · 2010-12-07 · via 博客园 - 撬棍

很荣幸,InstallShield提供了函数SetFileInfo,但是很遗憾该还属却不支持文件夹整体修改。

首先试验用WinApi SetFileAttributsA,失败了!不知原因何故!

没有办法只能用InstallShield提供的FindAllFiles与SetFileInfo配合实现修改整个文件夹的文件属性设置。

function SetFileArrtibuteNomal(svDir)

  string svResult, svFileSpec, svMatchingFileName;

  int      nResult, nvResult;

begin

  svFileSpec=“*.*”;

  svMatchingFileName = "";

  //find the first file form folder

  nResult = Find AllFiles(svDir, svFileSpec, svMatchingFileName, RESET);

  while(nResult = 0)

    if(GetFileInfo(svMatchingFileName, FILE_ATTRIBUTE, nvResult, svResult) = 0) then

      if(nvResult = FILE_ATTR_NOMAL) then

        //the file is nomal;

      else

        if(FILE_ATTR_HIDDEN & nvResult ) then

          //the file is hidden;

          SetFileInfo(svMatchingFileName, FILE_ATTRIBUTE, FILE_ATTER_NOMAL,"");

        endif; 

        if(FILE_ATTR_READONLY & nvResult ) then 

          //the file is read-only;

          SetFileInfo(svMatchingFileName, FILE_ATTRIBUTE, FILE_ATTER_NOMAL,"");

        endif;

      endif;

    endif;

    //find the next file

    nResult = Find AllFiles(svDir, svFileSpec, svMatchingFileName, CONTINUE);  

  endwhile;

  //release the files

  nResult = Find AllFiles(svDir, svFileSpec, svMatchingFileName, CANCEL);  

end;

以上代码在InstallShield2009测试通过!