[Icons]
Name: {group}\启动数据库; Filename: {app}\Project1.exe;WorkingDir:{app} 
Name: {group}\{cm:UninstallProgram,数据库}; Filename: {uninstallexe};WorkingDir:{app} 
Name: {userdesktop}\启动数据库; Filename: {app}\Project1.exe; Tasks: desktopicon;WorkingDir:{app} 
比如很多地方都会用到"启动数据库"我想设置一个公共变量
db=启动数据库其他地方引用db即可,这要怎么设置呢?

解决方案 »

  1.   

    你可以這樣做:
    直接在連接數據庫的代碼中增加一個boolean全局變量,當connect成功時,為true;失敗返回為false...然後直接在其它地方使用時,再用if+try...finally...end判斷即可.......
      
      

  2.   


    顶部声明#define test "test_txt"引用
    Name: "{commondesktop}\{#test}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; 脚本由 Inno Setup 脚本向导 生成!
    ; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!#define MyAppName "我的程序"
    #define MyAppVerName "我的程序 1.5"
    #define MyAppPublisher "我的公司"
    #define MyAppURL "http://www.example.com/"
    #define MyAppExeName "MyProg.exe"
    #define test "test_txt"
    [Setup]
    ; 注: AppId的值为单独标识该应用程序。
    ; 不要为其他安装程序使用相同的AppId值。
    ; (生成新的GUID,点击 工具|在IDE中生成GUID。)
    AppId={{110DA961-E497-4ABC-8A8E-18AF467F0621}
    AppName={#MyAppName}
    AppVerName={#MyAppVerName}
    AppPublisher={#MyAppPublisher}
    AppPublisherURL={#MyAppURL}
    AppSupportURL={#MyAppURL}
    AppUpdatesURL={#MyAppURL}
    DefaultDirName={pf}\{#MyAppName}
    DefaultGroupName={#MyAppName}
    OutputBaseFilename=setup
    Compression=lzma
    SolidCompression=yes[Languages]
    Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"[Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1[Files]
    Source: "d:\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
    ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”[Icons]
    Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
    Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
    Name: "{commondesktop}\{#test}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon[Run]
    Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent
      

  3.   

    #define  提示无效的编辑器指令