setup factory自定义目录时,强制固定目录,也就是目录自动补全

原文博客在这个连接:https://blog.csdn.net/galaxyjs/article/details/4157131

但是这个博客的东西有一丢丢小问题,

(1)一个就是反斜杠的方向反了,
(2)另一个就是你直接粘贴上述博客。可能会有格式问题导致的空格多余的问题,会导致编不过,注意粘贴完之后去掉多余空格。

截图看下我编过的版本:

在这里插入图片描述

function g_EditFieldFolderBrowse(nIDEditField, strPrompt)
-- get the current properties of the edit field
local tbEditProps = DlgEditField.GetProperties(nIDEditField);
if(not tbEditProps) then
-- The edit field is not accessible or does not exist
return;
end
-- display a folder browse dialog, using the current contents of the edit
-- field as the initial folder path (the folder to start browsing from)
local strInitialFolder = tbEditProps.Text;
local strTargetFolder = Dialog.FolderBrowse(strPrompt, strInitialFolder);
if((strTargetFolder == "") or (strTargetFolder == "CANCEL")) then
return;
end
-- replace the contents of the edit field with the folder path that was selected
--修改的内容,添加程序文件夹
strCCCn = SessionVar.Expand("%ProductName_1%");
tbEditProps.Text = strTargetFolder.."\\"..strCCCn;
tbEditProps.Text = String.Replace(tbEditProps.Text,"\\\\", "\\",false);
tbEditProps.Text = String.Replace(tbEditProps.Text,strCCCn,strCCCn,false);
--去掉重复的文件夹
DlgEditField.SetProperties(nIDEditField,tbEditProps);
end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值