كيف تضيف تركيب سلاسل محسوبة إلى البرامج النصية Innosetup؟
-
11-12-2019 - |
سؤال
حاليا عندما أقوم بترقية برنامج أقوم بعمل نسخة احتياطية من الملفات الموجودة إلى مجلد باسم النسخة الاحتياطية في دليل البرنامج على سبيل المثال. giveacodicetagpre.
هل هناك طريقة لتحديد أو حساب سلاسل حتى يكون الرمز شيء مثل giveacodicetagpre.
أو الجمع بين تاريخ مع معلومات حول الإصدار السابق giveacodicetagpre.
المحلول
Please read Pascal Scripting: Scripted Constants and Pascal Scripting: Support Functions Reference. Also read this and this. Anyway, this is how I did it:
[Dirs]
; create an empty folder...
Name: "{app}\{code:MyDateTimeString}"
[Code]
function MyDateTimeString(Param: String): String;
begin
Result := GetDateTimeString('yyyy.mm.dd_hh.nn.ss', #0, #0);
end;
نصائح أخرى
You can add runtime dynamic values using {code:...}
constants.
An example of getting the current date and making a backup of the installation folder can be seen on the ISXKB wiki
لا تنتمي إلى StackOverflow