小编fub*_*bar的帖子

为什么我们不能在inno-setup [Code]中声明局部const变量?

你知道为什么在声明本地const变量时脚本无法编译吗?对不起,我知道很少帕斯卡尔,也无法弄清楚为什么这不起作用!

这个例子(参见CircleArea函数)显示我的语法应该没问题. http://www.tutorialspoint.com/pascal/pascal_quick_guide.htm

这就是我想要做的:

//---placed within [Code]
procedure MyLog(const _functionName, _msg: String);
begin
  Log(_functionName + '(): ' + _msg);
end;

function MyExec(const _filename, _params, _dir: String): Boolean;
const // <--- compilation fails in this line!
  MethodName = 'MyExec';
var
  ResultCode: Integer;
begin
  MyLog(MethodName, _filename);
  // ... invoke Exec(), etc. ...
end;
//---
Run Code Online (Sandbox Code Playgroud)

pascal inno-setup const pascalscript

5
推荐指数
1
解决办法
3412
查看次数

inno-setup 的磁盘缓存问题?

我会尽量简短,不附上所有相关的源文件。我已经尽可能多地追查这个问题了我的帕斯卡知识允许我......

我认为我发现在步骤ssInstall中发生了磁盘缓存问题。我有一个应用程序的安装程序,如果它发现安装了较旧的应用程序版本,它将调用如下卸载:

procedure CurStepChanged(CurStep: TSetupStep);
var
  uninstallStr: String;
  ResultCode: Integer;
begin
  if (CurStep = ssInstall) and IsUpdatableApplicationInstalled() then
  begin
  uninstallStr := GetUninstallString();
  uninstallStr := RemoveQuotes(uninstallStr);
  Result := Exec(uninstallStr, '/SILENT /NORESTART /SUPPRESSMSGBOXES', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  if Result and (ResultCode = 0) then
    Log('CurStepChanged = ssInstall; uninstall OK');
  //-------------
  //Sleep(30000);
  //-------------
end;
Run Code Online (Sandbox Code Playgroud)

文件夹/文件的定义如下:

[Dirs]
Name: "{app}\db"; Flags: uninsalwaysuninstall

[Files]
Source: "..\bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "..\java\jre\*"; DestDir: "{app}\jre"; Flags: ignoreversion recursesubdirs createallsubdirs
blah...
Run Code Online (Sandbox Code Playgroud)

测试用例1;正常安装:一切顺利。日志文件部分:

Starting …
Run Code Online (Sandbox Code Playgroud)

caching inno-setup

2
推荐指数
1
解决办法
2018
查看次数

有条件地在MyBatis中执行<selectKey>

我有这个问题.只有当提供的bookTypeId为null时,我才需要执行selectKey来为我提供id .可以吗?

这是插入函数映射:

<insert id="insert" parameterType="BookType">
    <selectKey resultType="Integer" keyProperty="bookTypeId" order="BEFORE">
        SELECT nextval('seq_book_type')
    </selectKey>
    INSERT INTO book_type(
        book_type_id,
        book_type_desc
    )
    VALUES(
        #{bookTypeId},
        #{bookTypeDesc}
    )
</insert>
Run Code Online (Sandbox Code Playgroud)

mybatis

1
推荐指数
1
解决办法
4748
查看次数

标签 统计

inno-setup ×2

caching ×1

const ×1

mybatis ×1

pascal ×1

pascalscript ×1