inno setup打包问题(200分)

  • 主题发起人 主题发起人 gf101xt
  • 开始时间 开始时间
G

gf101xt

Unregistered / Unconfirmed
GUEST, unregistred user!
我想在inno的脚本的
代码:
段加入下面代码,但是在编译的时候提示出错,请那个富翁帮助解答,谢谢!
[Code]
 const
  Base64: string = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz~#%&*+-';
  UnBase64: array[0..255] of byte =
     (128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, //0-15
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //16-31
      128,128,128, 58,128, 59, 60,128, 128,128, 61, 62,128, 63,128,128,  //32-47
      128,128,  0,  1,  2,  3,  4,  5,   6,  7,128,128,128,128,128,128,  //48-63
      128,  8,  9, 10, 11, 12, 13, 14,  15,128, 16, 17, 18, 19, 20,128,  //64-79
       21, 22, 23, 24, 25, 26, 27, 28,  29, 30, 31,128,128,128,128,128,  //80-95
      128, 32, 33, 34, 35, 36, 37, 38,  39, 40, 41, 42,128, 43, 44, 45,  //96-111
       46, 47, 48, 49, 50, 51, 52, 53,  54, 55, 56,128,128,128, 57,128,  //112-127
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //128-143
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //144-159
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //160-175
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //176-191
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //192-207
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //208-223
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,  //224-239
      128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128);
 //240-255
function Base64Encode(const s: string): string;
var
  s4: string;
  i, j, k: integer;
  b: byte;
begin
  Result := '';
  SetLength(s4, 4);
  b := 0;
  i := 1;
  j := 2;
  k := 2;
  while i <= length(s)do
  begin
    b := b or ((ord(s[i]) and $C0) shr k);
    inc(k,2);
    s4[j] := Base64[(ord(s[i]) and $3F)+1];
    inc(i);
    inc(j);
    if j > 4 then
    begin
      s4[1] := Base64[b+1];
      b := 0;
      j := 2;
      k := 2;
      Result := Result + s4;
    end;
  end;
  if j <> 2 then
  begin
 // Flush data in s4.
    s4[j] := '.';
    s4[1] := Base64[b+1];
    Result := Result + s4;
    SetLength(Result, Length(Result) - (4 - j));
  end
  else
 Result := Result + '.';
end;

function Base64Decode(const s: string): string;
var
  i, j, k: integer;
  b: byte;
begin
  Result := '';
  b := 0;
  i := 1;
  j := 0;
  k := 2;
  while (i <= length(s)) and (s[i] <> '.')do
  begin
    if j = 0 then
    begin
      b := UnBase64[ord(s[i])];
      k := 2;
    end
    else
    begin
      Result := Result + chr(UnBase64[ord(s[i])] or ((b shl k) and $C0));
      inc(k,2);
    end;
    inc(j);
    j := j and 3;
    inc(i);
  end;
end;
 
编译好象是有问题,你可以写在程序里来实现编码的哦!
"const"好象不能编译.
 
你去下载我的汉化编译的Inno Setup
我默认增加有Base64函数了
http://u.skygz.com/mypane.aspx?down=ok&amp;filepath=skygz%2f%ba%ba%bb%af%2fha_innosetup5203_skygz.rar
 
to 风铃夜思雨
5.2.3版本是有Base64函数功能的,但是我想把上面的函数通过
代码:
段来实现
编译的时候就是提示Base64: string = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz~#%&amp;*+-';
  UnBase64: array[0..255] of byte =
部分出错!
 
INNO的代码段,不支持常量定义数组的
const
Base64= '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz~#%&amp;*+-';
这句可以这样
UnBase64: array[0..255] of byte =(...............)
这句是不支持的
 

Similar threads

I
回复
0
查看
643
import
I
I
回复
0
查看
639
import
I
I
回复
0
查看
681
import
I
后退
顶部