- Реестр режимов постобработки вместо бинарного summary_mode: Чистая диктовка, Чистовик (без паразитов), Summary, Переводчик RU→EN, Промпт для LLM, Буллеты, Деловое письмо - Кастомные стили: свои промпты в настройках (таб «Стили») - Новая иконка приложения (микрофон + VД) - Прослушка звуков в настройках (кнопки ▶) - ffmpeg как опциональная докачка (кнопка в настройках), WAV-fallback без него - Версия 0.2.0 + changelog в «О программе» - Фикс: сохранение настроек через dataclasses.replace (не теряет поля) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
133 lines
4.1 KiB
Text
133 lines
4.1 KiB
Text
[Setup]
|
|
AppName=Voice Dictator
|
|
AppVersion=0.2.0
|
|
AppPublisher=Flowmasters
|
|
DefaultDirName={autopf}\VoiceDictator
|
|
DefaultGroupName=Voice Dictator
|
|
UninstallDisplayIcon={app}\VoiceDictation.exe
|
|
SetupIconFile=assets\app_icon.ico
|
|
OutputDir=installer_output
|
|
OutputBaseFilename=VoiceDictator-Setup
|
|
Compression=lzma2
|
|
SolidCompression=yes
|
|
PrivilegesRequired=lowest
|
|
ArchitecturesInstallIn64BitMode=x64compatible
|
|
WizardStyle=classic
|
|
DisableWelcomePage=yes
|
|
DisableDirPage=yes
|
|
|
|
[Files]
|
|
Source: "dist\VoiceDictation\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
|
|
Source: "assets\bg_full.bmp"; Flags: dontcopy
|
|
|
|
[Icons]
|
|
Name: "{group}\Voice Dictator"; Filename: "{app}\VoiceDictation.exe"; WorkingDir: "{app}"
|
|
Name: "{group}\Uninstall Voice Dictator"; Filename: "{uninstallexe}"
|
|
Name: "{autodesktop}\Voice Dictator"; Filename: "{app}\VoiceDictation.exe"; WorkingDir: "{app}"; Comment: "Voice Dictator"
|
|
Name: "{userstartup}\Voice Dictator"; Filename: "{app}\VoiceDictation.exe"; WorkingDir: "{app}"; Comment: "Voice Dictator autostart"
|
|
|
|
[Run]
|
|
Filename: "{app}\VoiceDictation.exe"; Description: "Запустить Voice Dictator"; Flags: nowait postinstall skipifsilent
|
|
|
|
[Code]
|
|
var
|
|
DirPage: TWizardPage;
|
|
ApiKeyPage: TWizardPage;
|
|
DirEdit: TNewEdit;
|
|
DirBrowseBtn: TNewButton;
|
|
DirLabel: TNewStaticText;
|
|
ApiKeyEdit: TNewEdit;
|
|
ApiKeyLabel: TNewStaticText;
|
|
|
|
procedure DirBrowseClick(Sender: TObject);
|
|
var
|
|
Dir: String;
|
|
begin
|
|
Dir := DirEdit.Text;
|
|
if BrowseForFolder('Выберите папку установки:', Dir, False) then
|
|
DirEdit.Text := Dir;
|
|
end;
|
|
|
|
procedure SetupBgOnPage(Page: TWizardPage; var Lbl: TNewStaticText; var Edit: TNewEdit; LabelText: String);
|
|
var
|
|
BmpFile: String;
|
|
BgImg: TBitmapImage;
|
|
begin
|
|
ExtractTemporaryFile('bg_full.bmp');
|
|
BmpFile := ExpandConstant('{tmp}\bg_full.bmp');
|
|
|
|
BgImg := TBitmapImage.Create(Page);
|
|
BgImg.Parent := Page.Surface;
|
|
BgImg.Bitmap.LoadFromFile(BmpFile);
|
|
BgImg.Stretch := True;
|
|
BgImg.SetBounds(0, 0, Page.SurfaceWidth, Page.SurfaceHeight);
|
|
|
|
Lbl := TNewStaticText.Create(Page);
|
|
Lbl.Parent := Page.Surface;
|
|
Lbl.Caption := LabelText;
|
|
Lbl.Font.Color := clBlack;
|
|
Lbl.Font.Size := 12;
|
|
Lbl.Font.Style := [fsBold];
|
|
Lbl.AutoSize := True;
|
|
Lbl.Left := 20;
|
|
Lbl.Top := Page.SurfaceHeight - 80;
|
|
Lbl.Width := 400;
|
|
|
|
Edit := TNewEdit.Create(Page);
|
|
Edit.Parent := Page.Surface;
|
|
Edit.Left := 20;
|
|
Edit.Top := Page.SurfaceHeight - 55;
|
|
Edit.Width := Page.SurfaceWidth - 130;
|
|
Edit.Font.Size := 10;
|
|
Edit.Color := $1A1A1A;
|
|
Edit.Font.Color := clWhite;
|
|
end;
|
|
|
|
procedure InitializeWizard;
|
|
var
|
|
BmpFile: String;
|
|
BgImg: TBitmapImage;
|
|
begin
|
|
// Скрываем стандартные элементы
|
|
WizardForm.WizardBitmapImage.Visible := False;
|
|
WizardForm.WizardBitmapImage2.Visible := False;
|
|
WizardForm.MainPanel.Visible := False;
|
|
WizardForm.PageNameLabel.Visible := False;
|
|
WizardForm.PageDescriptionLabel.Visible := False;
|
|
|
|
// --- Страница 1: путь установки ---
|
|
DirPage := CreateCustomPage(wpWelcome, '', '');
|
|
SetupBgOnPage(DirPage, DirLabel, DirEdit, 'Папка установки:');
|
|
DirEdit.Text := ExpandConstant('{autopf}\VoiceDictator');
|
|
|
|
DirBrowseBtn := TNewButton.Create(DirPage);
|
|
DirBrowseBtn.Parent := DirPage.Surface;
|
|
DirBrowseBtn.Caption := 'Browse...';
|
|
DirBrowseBtn.Left := DirEdit.Left + DirEdit.Width + 10;
|
|
DirBrowseBtn.Top := DirEdit.Top - 2;
|
|
DirBrowseBtn.Width := 80;
|
|
DirBrowseBtn.Height := 25;
|
|
DirBrowseBtn.OnClick := @DirBrowseClick;
|
|
|
|
// --- Страница 2: API ключ ---
|
|
ApiKeyPage := CreateCustomPage(DirPage.ID, '', '');
|
|
SetupBgOnPage(ApiKeyPage, ApiKeyLabel, ApiKeyEdit, 'OpenAI API Key:');
|
|
end;
|
|
|
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
|
begin
|
|
Result := True;
|
|
if CurPageID = DirPage.ID then
|
|
WizardForm.DirEdit.Text := DirEdit.Text;
|
|
end;
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
var
|
|
EnvContent: String;
|
|
begin
|
|
if CurStep = ssPostInstall then
|
|
begin
|
|
EnvContent := 'OPENAI_API_KEY=' + ApiKeyEdit.Text + #13#10 + 'OPENAI_ADMIN_API_KEY=' + #13#10;
|
|
SaveStringToFile(ExpandConstant('{app}\.env'), EnvContent, False);
|
|
end;
|
|
end;
|