Files
desktop-apps/win-linux/package/windows/associate_page.iss
2020-06-10 15:46:30 +03:00

646 lines
28 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[Setup]
ChangesAssociations=true
[CustomMessages]
en.AssociateDescription =Associate office document file types with {#ASSC_APP_NAME}
pt_BR.AssociateDescription =Associe tipos de arquivos de documento office com {#ASSC_APP_NAME}
cs_CZ.AssociateDescription =Přiřadit typy souborů kancelářských dokumentů {#ASSC_APP_NAME}
sk.AssociateDescription =Priradiť typy súborov kancelárskych dokumentov {#ASSC_APP_NAME}
ru.AssociateDescription =Ассоциировать типы файлов офисных документов с {#ASSC_APP_NAME}
de.AssociateDescription =Office-Dokument-Dateitypen {#ASSC_APP_NAME} zuordnen
fr.AssociateDescription =Associer les types de fichiers de documents de bureau avec {#ASSC_APP_NAME}
es.AssociateDescription =Asociar los tipos de archivo de documentos office con {#ASSC_APP_NAME}
it_IT.AssociateDescription =Associa tipi di file di documenti office con {#ASSC_APP_NAME}
pl.AssociateDescription =Skojarz rodzaje plików dokumentów biurowych z {#ASSC_APP_NAME}
zh_CN.AssociateDescription =关联office文档文件类型与{#ASSC_APP_NAME}
en.AssociateCaption =File Associations
pt_BR.AssociateCaption =Associações de arquivos
cs_CZ.AssociateCaption =Asociace souboru
sk.AssociateCaption =Asociácia súboru
ru.AssociateCaption =Ассоциации файлов
de.AssociateCaption =Dateiassoziationen
fr.AssociateCaption =Associations de fichiers
es.AssociateCaption =Asociaciones de archivos
it_IT.AssociateCaption =Associazioni dei file
pl.AssociateCaption =Skojarzenia Plików
zh_CN.AssociateCaption =文件关联
en.AssociateDont =Do not associate
pt_BR.AssociateDont =Não associar
cs_CZ.AssociateDont =Neasociováno
sk.AssociateDont =Neasociované
ru.AssociateDont =Не ассоциировать
de.AssociateDont =Nicht assoziieren
fr.AssociateDont =Ne pas associer
es.AssociateDont =No asociar
it_IT.AssociateDont =Non associare
pl.AssociateDont =Nie kojarz
zh_CN.AssociateDont =不关联
en.AssociateAll =Associate all
pt_BR.AssociateAll =Associar todos
cs_CZ.AssociateAll =Asociovat vše
sk.AssociateAll =Asociovať všetko
ru.AssociateAll =Ассоциировать все
de.AssociateAll =Alle assoziieren
fr.AssociateAll =Associer tous
es.AssociateAll =Asociar todo
it_IT.AssociateAll =Associare tutto
pl.AssociateAll =Skojarz wszystkie
zh_CN.AssociateAll =全部关联
en.AssociateSel =Associate selected
pt_BR.AssociateSel =Associar selecionados
cs_CZ.AssociateSel =Vybraná asociace
sk.AssociateSel =Vybraná asociácia
ru.AssociateSel =Ассоциировать выбранные
de.AssociateSel =Ausgewählte assoziieren
fr.AssociateSel =Associer sélectionnés
es.AssociateSel =Asociar seleccionado
it_IT.AssociateSel =Associare selezione
pl.AssociateSel =Skojarz wybrane
zh_CN.AssociateSel =关联选定内容
en.AssociateAudio =File types
pt_BR.AssociateAudio =Tipos de arquivo
cs_CZ.AssociateAudio =Typy souborů
sk.AssociateAudio =Typy súborov
ru.AssociateAudio =Типы файлов
de.AssociateAudio =Dateitypen
fr.AssociateAudio =Types de fichiers
es.AssociateAudio =Tipos de archivos
it_IT.AssociateAudio =Tipi di file
pl.AssociateAudio =Rodzaje plików
zh_CN.AssociateAudio =文件类型
en.extMSWord =Microsoft Word Document
pt_BR.extMSWord =Documento Microsoft Word
cs_CZ.extMSWord =Microsoft Word Dokument
sk.extMSWord =Microsoft Word Dokument
ru.extMSWord =Документ Microsoft Word
de.extMSWord =Microsoft Word Dokument
fr.extMSWord =Document Microsoft Word
es.extMSWord =Documento de Microsoft Word
it_IT.extMSWord =Documento di Microsoft Word
pl.extMSWord =Dokument Microsoft Word
zh_CN.extMSWord =Microsoft Word文档
en.extMSExcel =Microsoft Excel Workbook
pt_BR.extMSExcel =Planilha Microsoft Excel
cs_CZ.extMSExcel =Microsoft Excel Sešit
sk.extMSExcel =Microsoft Excel Zošit
ru.extMSExcel =Книга Microsoft Excel
de.extMSExcel =Microsoft Excel Arbeitsmappe
fr.extMSExcel =Classeur Microsoft Excel
es.extMSExcel =Libro de Microsoft Excel
it_IT.extMSExcel =Libro di Microsoft Excel
pl.extMSExcel =Skoroszyt Microsoft Excel
zh_CN.extMSExcel =Microsoft Excel工作簿
en.extMSPresentation =Microsoft PowerPoint Presentation
pt_BR.extMSPresentation =Apresentação Microsoft PowerPoint
cs_CZ.extMSPresentation =Microsoft PowerPoint Prezentace
sk.extMSPresentation =Microsoft PowerPoint Prezentácia
ru.extMSPresentation =Презентация Microsoft PowerPoint
de.extMSPresentation =Microsoft PowerPoint Präsentation
fr.extMSPresentation =Présentation Microsoft PowerPoint
es.extMSPresentation =Presentación de Microsoft PowerPoint
it_IT.extMSPresentation =Presentazione di Microsoft PowerPoint
pl.extMSPresentation =Prezentacja Microsoft PowerPoint
zh_CN.extMSPresentation =Microsoft PowerPoint演示文稿
en.extMSSlideshow =Microsoft PowerPoint Slideshow
pt_BR.extMSSlideshow =Apresentações do PowerPoint da Microsoft
cs_CZ.extMSSlideshow =Microsoft PowerPoint Slideshow
sk.extMSSlideshow =Microsoft PowerPoint Slideshow
ru.extMSSlideshow =Слайдшоу Microsoft PowerPoint
de.extMSSlideshow =Microsoft PowerPoint Slideshow
fr.extMSSlideshow =Diaporama Microsoft PowerPoint
es.extMSSlideshow =Presentación de Microsoft PowerPoint
it_IT.extMSSlideshow =Microsoft PowerPoint Slideshow
pl.extMSSlideshow =Pokaz Slajdów Microsoft PowerPoint
zh_CN.extMSSlideshow =Microsoft PowerPoint幻灯片
en.extODT =OpenDocument Text Document
pt_BR.extODT =Documento de Texto do OpenDocument
cs_CZ.extODT =Dokumenty OpenDocument
sk.extODT =Dokumenty OpenDocument
ru.extODT =Текстовый документ OpenDocument
de.extODT =OpenDocument Textdokument
fr.extODT =Document OpenDocument Texte
es.extODT =Documento de texto de OpenDocument
it_IT.extODT =Documento di testo di OpenDocument
pl.extODT =Dokument Tekstowy OpenDocument
zh_CN.extODT =OpenDocument文本文件
en.extODS =OpenDocument Spreadsheet
pt_BR.extODS =Planilha do OpenDocument
cs_CZ.extODS =Sešit OpenDocument
sk.extODS =Zošit OpenDocument
ru.extODS =Электронная таблица OpenDocument
de.extODS =OpenDocument Tabelle
fr.extODS =Classeur OpenDocument
es.extODS =Hoja de cálculo de OpenDocument
it_IT.extODS =OpenDocument Spreadsheet
pl.extODS =Arkusz Kalkulacyjny OpenDocument
zh_CN.extODS =OpenDocument电子表格
en.extODP =OpenDocument Presentation
pt_BR.extODP =Apresentação do OpenDocument
cs_CZ.extODP =Prezentace OpenDocument
sk.extODP =Prezentácia OpenDocument
ru.extODP =Презентация OpenDocument
de.extODP =OpenDocument  Präsentation
fr.extODP =Présentation OpenDocument
es.extODP =Presentación de OpenDocument
it_IT.extODP =Presentazione di OpenDocument
pl.extODP =Prezentacja OpenDocument
zh_CN.extODP =OpenDocument演示文稿
en.defprogAppDescription=Free desktop office suite for document editing and collaboration
pt_BR.defprogAppDescription=Pacote office para desktop gratuito para edição e colaboração em documentos
cs_CZ.defprogAppDescription=Volně dostupný desktopový balíček pro úpravu dokumentů a spolupráci
sk.defprogAppDescription=Bezplatná kancelárska sada pre stolné počítače na úpravu dokumentov a spoluprácu
ru.defprogAppDescription=Бесплатный десктопный офисный пакет для редактирования документов и совместной работы
de.defprogAppDescription=Kostenlose Desktop-Office-Suite für Dokumentenbearbeitung und Zusammenarbeit
fr.defprogAppDescription=Suite bureautique d'applications de bureau gratuite pour l'édition de documents et la collaboration
es.defprogAppDescription=Paquete desktop de oficina gratuito para edición de documentos y colaboración
it_IT.defprogAppDescription=Suite gratuita per l'ufficio desktop per la modifica e la collaborazione in tempo reale di documenti
pl.defprogAppDescription=Bezpłatny pakiet biurowy do edycji dokumentów i kolaboracji
zh_CN.defprogAppDescription=用于文档编辑和协作的免费桌面办公套件
en.warnWin10FileAssociationDesc=To associate the files with the application, open the following window after the installation is complete:
pt_BR.warnWin10FileAssociationDesc=Para associar os arquivos com o aplicativo, abra a seguinte janela após a instalação estar completa:
cs_CZ.warnWin10FileAssociationDesc=Pro připojení souborů k aplikaci, otevřete následující okno po dokončení aplikace:
sk.warnWin10FileAssociationDesc=Ak chcete súbory priradiť k aplikácii, po dokončení inštalácie otvorte nasledujúce okno:
ru.warnWin10FileAssociationDesc=Чтобы ассоциировать файлы с приложением, откройте следующее окно после того, как установка будет завершена:
de.warnWin10FileAssociationDesc=Nachdem die Installation abgeschlossen ist, öffnen Sie das folgende Feld, um die Dateien mit der Anwendung zu verknüpfen:
fr.warnWin10FileAssociationDesc=Pour associer les fichiers avec le logiciel après son installation, ouvre la fenêtre suivante:
es.warnWin10FileAssociationDesc=Para asociar los archivos con la aplicación, abra la siguiente ventana una vez finalizada la instalación:
it_IT.warnWin10FileAssociationDesc=Per associare i file allapplicazione, apri la seguente finestra al termine dellinstallazione:
pl.warnWin10FileAssociationDesc=Aby skojarzyć pliki z aplikacją, otwórz następujące okno po zakończeniu instalacji:
zh_CN.warnWin10FileAssociationDesc=如需关联文件与应用程序,请在安装完成后打开以下窗口:
en.warnWin10FileAssociationPath=Settings > Apps > Default apps
pt_BR.warnWin10FileAssociationPath=Configurações > Aplicativos > Aplicativos padrão
cs_CZ.warnWin10FileAssociationPath=Nastavení > Aplikace > Výchozí aplikace
sk.warnWin10FileAssociationPath=Nastavenia> Aplikácie> Predvolené aplikácie
ru.warnWin10FileAssociationPath=Настройки > Приложения > Приложения по умолчанию
de.warnWin10FileAssociationPath=Einstellungen > Apps > Standard-Apps
fr.warnWin10FileAssociationPath=Paramètres > Apps > Logiciels par défaut
es.warnWin10FileAssociationPath=Ajustes > Aplicaciones > Aplicaciones predeterminadas
it_IT.warnWin10FileAssociationPath=Impostazioni > Apps > App predefinite
pl.warnWin10FileAssociationPath=Ustawienia > Aplikacje > Domyślne aplikacje
zh_CN.warnWin10FileAssociationPath=设置 > 应用 > 默认应用
en.runOpenDefaultApps=Open Default apps
pt_BR.runOpenDefaultApps=Abrir apps predefinidos
cs_CZ.runOpenDefaultApps=Otevřít výchozí aplikaci
sk.runOpenDefaultApps=Otvorte predvolené aplikácie
ru.runOpenDefaultApps=Открыть Приложения по умолчанию
de.runOpenDefaultApps=Standardanwendungen öffnen
fr.runOpenDefaultApps=Ouvrir les applications par défaut
es.runOpenDefaultApps=Abrir programas predeterminados
it_IT.runOpenDefaultApps=Apri apps di Default
pl.runOpenDefaultApps=Otwórz Domyślne aplikacje
zh_CN.runOpenDefaultApps=打开默认应用
[Run]
Filename: ms-settings:defaultapps; Description: {cm:runOpenDefaultApps}; Flags:postinstall shellexec nowait unchecked; MinVersion: 10.0.10240;
[Registry]
Root: HKLM; Subkey: Software\Classes\{#ASSOC_PROG_ID}; Flags: uninsdeletekey
Root: HKLM; Subkey: Software\Classes\{#ASSOC_PROG_ID}; ValueType: string; ValueName:; ValueData: {#ASSOC_APP_FRIENDLY_NAME};
Root: HKLM; Subkey: Software\Classes\{#ASSOC_PROG_ID}\DefaultIcon; ValueType: string; ValueName:; ValueData: "{app}\{#iconsExe},0";
Root: HKLM; Subkey: Software\Classes\{#ASSOC_PROG_ID}\shell\open\command; ValueType: string; ValueName:; ValueData: """{app}\{#iconsExe}"" ""%1""";
Root: HKLM; Subkey: Software\Classes\{#ASSOC_PROG_ID}\shell\open; ValueType: string; ValueName: FriendlyAppName; ValueData: {#ASSOC_APP_FRIENDLY_NAME};
[Code]
type
TKeyValue = record
Key: string;
Value: string;
end;
TArrayOfValues = array of TKeyValue;
var
OnAudioClick: Boolean;
ChlbAudio: TNewCheckListBox;
AudioExtEnabled: Array of Boolean;
AudioExts: Array of String;
ExtensionRegistryInfo: array of string;
AChecked: Boolean;
associatePage: TWizardPage;
isFullAssociation: Boolean;
procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String);
var
i, p: Integer;
begin
i := 0;
repeat
SetArrayLength(Dest, i+1);
p := Pos(Separator,Text);
if p > 0 then begin
Dest[i] := Copy(Text, 1, p-1);
Text := Copy(Text, p + Length(Separator), Length(Text));
i := i + 1;
end else begin
Dest[i] := Text;
Text := '';
end;
until Length(Text)=0;
end;
procedure initExtensions;
var
prefix: string;
begin
SetArrayLength(AudioExts, 16);
SetArrayLength(AudioExtEnabled, GetArrayLength(AudioExts));
AudioExts[0] := 'DOC';
AudioExts[1] := 'DOCX';
AudioExts[2] := 'XLS';
AudioExts[3] := 'XLSX';
AudioExts[4] := 'PPT';
AudioExts[5] := 'PPTX';
AudioExts[6] := 'PPS';
AudioExts[7] := 'PPSX';
AudioExts[8] := 'ODT';
AudioExts[9] := 'ODS';
AudioExts[10] := 'ODP';
AudioExts[11] := 'RTF';
// AudioExts[12] := 'TXT';
AudioExts[12] := 'CSV';
AudioExts[13] := 'PDF';
AudioExts[14] := 'DJVU';
AudioExts[15] := 'XPS';
SetArrayLength(ExtensionRegistryInfo, GetArrayLength(AudioExts));
prefix := '{#ASCC_REG_PREFIX}' + '.';
ExtensionRegistryInfo[0] := prefix + 'Document.1:' + ExpandConstant('{cm:extMSWord}') + ':' + '11';
ExtensionRegistryInfo[1] := prefix + 'Document.12:' + ExpandConstant('{cm:extMSWord}') + ':' + '7';
ExtensionRegistryInfo[2] := prefix + 'Sheet.1:' + ExpandConstant('{cm:extMSExcel}') + ':' + '16';
ExtensionRegistryInfo[3] := prefix + 'Sheet.12:' + ExpandConstant('{cm:extMSExcel}') + ':' + '10';
ExtensionRegistryInfo[4] := prefix + 'Show.1:' + ExpandConstant('{cm:extMSPresentation}') + ':' + '1';
ExtensionRegistryInfo[5] := prefix + 'Show.12:' + ExpandConstant('{cm:extMSPresentation}') + ':' + '9';
ExtensionRegistryInfo[6] := prefix + 'SlideShow.1:' + ExpandConstant('{cm:extMSSlideshow}') + ':' + '2';
ExtensionRegistryInfo[7] := prefix + 'SlideShow.12:' + ExpandConstant('{cm:extMSSlideshow}') + ':' + '8';
ExtensionRegistryInfo[8] := prefix + 'Document.2:' + ExpandConstant('{cm:extODT}') + ':' + '12';
ExtensionRegistryInfo[9] := prefix + 'Sheet.2:' + ExpandConstant('{cm:extODS}') + ':' + '17';
ExtensionRegistryInfo[10] := prefix + 'Show.2:' + ExpandConstant('{cm:extODP}') + ':' + '3';
ExtensionRegistryInfo[11] := prefix + 'Rtf:' + ':' + '13';
//ExtensionRegistryInfo[12] := prefix + 'Txt:' + ':' + '14';
ExtensionRegistryInfo[12] := prefix + 'Csv:' + ':' + '18';
ExtensionRegistryInfo[13] := prefix + 'Pdf:' + ':' + '5';
ExtensionRegistryInfo[14] := prefix + 'DjVu:' + ':' + '4';
ExtensionRegistryInfo[15] := prefix + 'Xps:' + ':' + '6';
end;
procedure ChlbAudioClickCheck(Sender: TObject);
var
i: Integer;
begin
if not OnAudioClick then
begin
OnAudioClick := True;
if ChlbAudio.Checked[2] then
begin
if not AChecked then
begin
AChecked := True;
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
ChlbAudio.ItemEnabled[i + 3] := True;
ChlbAudio.Checked[i + 3] := AudioExtEnabled[i];
end;
end
else
begin
for i := 0 to GetArrayLength(AudioExts) - 1 do
AudioExtEnabled[i] := ChlbAudio.Checked[i + 3];
end;
end
else
begin
AChecked := False;
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
ChlbAudio.ItemEnabled[i + 3] := False;
// ChlbAudio.Checked[i + 3] := ArrAudio[i];
end;
end;
OnAudioClick := False;
ChlbAudio.Repaint;
end;
end;
procedure InitializeAssociatePage;
var
lblAudio: TLabel;
i: Integer;
version: TWindowsVersion;
createPage: Boolean;
paramSkip: string;
labelDesc, labelPath: TNewStaticText;
begin
initExtensions();
ChlbAudio := nil;
createPage := False;
if not WizardSilent then begin
paramSkip := GetCommandlineParam('/skip');
if (not Length(paramSkip) > 0) or (paramSkip <> 'associates') then begin
createPage := True
end
end;
if createPage then begin
associatePage := CreateCustomPage(wpSelectTasks, CustomMessage('AssociateCaption'), CustomMessage('AssociateDescription'));
GetWindowsVersionEx(version);
if version.Major < 10 then begin
lblAudio := TLabel.Create(associatePage);
lblAudio.Parent := associatePage.Surface;
lblAudio.WordWrap := True;
lblAudio.Caption := ExpandConstant('{cm:AssociateAudio}');
lblAudio.AutoSize := True;
lblAudio.Width := associatePage.SurfaceWidth;
lblAudio.Left := 0;
lblAudio.Top := 0;
ChlbAudio := TNewCheckListBox.Create(associatePage);
ChlbAudio.Parent := associatePage.Surface;
ChlbAudio.Left := 0;
ChlbAudio.Top := lblAudio.Top + lblAudio.Height + 4;
ChlbAudio.Width := associatePage.SurfaceWidth;
ChlbAudio.Height := associatePage.SurfaceHeight - ChlbAudio.Top - 4 - 3;
ChlbAudio.AddRadioButton(ExpandConstant('{cm:AssociateDont}'), '', 0, False, True, nil);
ChlbAudio.AddRadioButton(ExpandConstant('{cm:AssociateAll}'), '', 0, False, True, nil);
ChlbAudio.AddRadioButton(ExpandConstant('{cm:AssociateSel}'), '', 0, True, True, nil);
AChecked := True;
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
ChlbAudio.AddCheckBox(AudioExts[i], '', 1, False, True, False, False, nil);
AudioExtEnabled[i] := True;
end;
OnAudioClick := False;
ChlbAudio.OnClickCheck := @ChlbAudioClickCheck;
ChlbAudio.Checked[1] := True;
ChlbAudioClickCheck(ChlbAudio);
end else begin
labelDesc := TNewStaticText.Create(associatePage);
labelDesc.Parent := associatePage.Surface;
labelDesc.WordWrap := True;
labelDesc.Caption := ExpandConstant('{cm:warnWin10FileAssociationDesc}');
labelDesc.AutoSize := True;
labelDesc.Width := associatePage.SurfaceWidth;
labelDesc.Left := 0;
labelDesc.Top := 0;
labelPath := TNewStaticText.Create(associatePage);
labelPath.Parent := associatePage.Surface;
labelPath.WordWrap := True;
labelPath.Caption := ExpandConstant('{cm:warnWin10FileAssociationPath}');
labelPath.AutoSize := True;
labelPath.Width := associatePage.SurfaceWidth;
labelPath.Left := 0;
labelPath.Top := labelDesc.Top + 50;
labelPath.Font.Style := [fsBold];
end
end else begin
associatePage := nil
end;
//vc_desctopiconshow := True;
//WizardForm.TasksList.OnClickCheck := @OnTasksListClickCheck;
end;
//----------
function isAssociateExtension(index: Integer): Boolean;
begin
if ChlbAudio = nil then begin
if isFullAssociation then Result := True
else Result := False
end else
Result := ChlbAudio.Checked[1] or (ChlbAudio.Checked[2] and ChlbAudio.Checked[index + 3]);
end;
//----------
procedure AddToDefaultPrograms;
var
i: integer;
argsArray: TArrayOfString;
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, '{#APP_REG_PATH}\Capabilities', 'ApplicationDescription', ExpandConstant('{cm:defprogAppDescription}'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, '{#APP_REG_PATH}\Capabilities', 'ApplicationIcon', ExpandConstant('"{app}\{#NAME_EXE_OUT},0"'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, '{#APP_REG_PATH}\Capabilities', 'ApplicationName', '{#sAppName}');
for i := 0 to GetArrayLength(AudioExts) - 1 do begin
Explode(argsArray, ExtensionRegistryInfo[i],':');
RegWriteStringValue(HKEY_LOCAL_MACHINE, '{#APP_REG_PATH}\Capabilities\FileAssociations', '.' + LowerCase(AudioExts[i]), argsArray[0]);
end;
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\RegisteredApplications', '{#ASCC_REG_REGISTERED_APP_NAME}', '{#APP_REG_PATH}\Capabilities');
end;
function TryGetValue(const KeyValueList: TArrayOfValues; const Key: string; var Value: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 0 to GetArrayLength(KeyValueList) - 1 do
if KeyValueList[I].Key = Key then
begin
Result := True;
Value := KeyValueList[I].Value;
Exit;
end;
end;
procedure AddKeyValue(const destarray: TArrayOfValues; const key, value: string);
var
Index: Integer;
begin
Index := GetArrayLength(destarray);
SetArrayLength(destarray, Index + 1);
destarray[Index].Key := key;
destarray[Index].Value := value;
end;
procedure AddContextMenuNewItems;
var
langs: TArrayOfValues;
args, regpath: String;
progpath: String;
argsArray: TArrayOfString;
version: TWindowsVersion;
begin
AddKeyValue(langs, 'cs_CZ', 'cs-CZ:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'de', 'de-DE:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'es', 'es-ES:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'fr', 'fr-FR:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'it_IT', 'it-IT:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'pt_BR', 'pt-BR:new.docx:new.pptx:new.xlsx');
AddKeyValue(langs, 'ru', 'ru-RU:new.docx:new.pptx:new.xlsx');
if not TryGetValue(langs, ExpandConstant('{language}'), args) then
args := '.:mm_new.docx:mm_new.pptx:mm_new.xlsx';
Explode(argsArray, args, ':');
if argsArray[0] = '.' then
progpath := ExpandConstant('{app}\converter\empty')
else progpath := ExpandConstant('{app}\converter\empty\' + argsArray[0]);
regpath := ExpandConstant('Software\Classes\.docx\{#ASCC_REG_PREFIX}.Document.12\ShellNew');
if not RegKeyExists(HKEY_LOCAL_MACHINE, regpath) then
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'IconPath', ExpandConstant('{app}\{#iconsExe},7'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'FileName', progpath + '\' + argsArray[1]);
end;
regpath := ExpandConstant('Software\Classes\.pptx\{#ASCC_REG_PREFIX}.Show.12\ShellNew');
if not RegKeyExists(HKEY_LOCAL_MACHINE, regpath) then
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'IconPath', ExpandConstant('{app}\{#iconsExe},9'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'FileName', progpath + '\' + argsArray[2]);
end;
regpath := ExpandConstant('Software\Classes\.xlsx\{#ASCC_REG_PREFIX}.Sheet.12\ShellNew');
if not RegKeyExists(HKEY_LOCAL_MACHINE, regpath) then
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'IconPath', ExpandConstant('{app}\{#iconsExe},10'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, regpath, 'FileName', progpath + '\' + argsArray[3]);
end;
GetWindowsVersionEx(version);
if (version.Major = 10) and CheckCommandlineParam('/FORCEADDMENUNEW') then begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.docx', '', '{#ASCC_REG_PREFIX}.Document.12')
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.xlsx', '', '{#ASCC_REG_PREFIX}.Sheet.12')
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.pptx', '', '{#ASCC_REG_PREFIX}.Show.12')
end;
end;
procedure DoPostInstall();
var
i: Integer;
ext, progId1, progId2: string;
argsArray: TArrayOfString;
begin
isFullAssociation := CheckCommandlineParam('/FULLASSOCIATION');
if (associatePage = nil) and isFullAssociation then begin
initExtensions();
end;
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
Explode(argsArray, ExtensionRegistryInfo[i],':');
// checking existance is temporary locked to rewrite new icons indexes
//if not RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0]) then begin
if Length(argsArray[1]) <> 0 then
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0], '', argsArray[1]);
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0] + '\DefaultIcon', '', ExpandConstant('{app}\{#iconsExe},' + argsArray[2]));
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0] + '\shell\open\command', '', ExpandConstant('"{app}\{#iconsExe}" "%1"'));
//end;
ext := LowerCase(AudioExts[i]);
if isAssociateExtension(i) then
begin
if not RegValueExists(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext, '') then begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext, '', argsArray[0])
end else
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext, '', progId1);
if not RegValueExists(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext + '\OpenWithProgids', argsArray[0]) then
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext + '\OpenWithProgids', argsArray[0], '');
if RegValueExists(HKEY_CURRENT_USER, 'Software\Classes\.' + ext, '') then
RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Classes\.' + ext, '', progId2);
if ((Length(progId2) <> 0) and (CompareText(progId2, argsArray[0]) <> 0)) or
((Length(progId1) <> 0) and (CompareText(progId1, argsArray[0]) <> 0)) then
begin
RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.' + ext + '\UserChoice');
RegWriteStringValue(HKEY_CURRENT_USER, 'Software\Classes\.' + ext, '', argsArray[0])
//RegWriteStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.' + ext + '\UserChoice', 'Progid', argsArray[0]);
end;
end else
begin
//RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext + '\OpenWithProgids', argsArray[0], '');
end;
end;
AddToDefaultPrograms;
AddContextMenuNewItems;
end;
{
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
begin
MsgBox(MemoDirInfo, mbInformation, MB_OK);
Result:=MemoUserInfoInfo + NewLine + MemoDirInfo + NewLine + MemoTypeInfo + NewLine + MemoComponentsInfo + NewLine + MemoGroupInfo + NewLine + MemoTasksInfo;
end;
}
procedure UnassociateExtensions;
var
i: Integer;
argsArray: TArrayOfString;
ext, str: string;
begin
initExtensions();
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
Explode(argsArray, ExtensionRegistryInfo[i],':');
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0]);
ext := LowerCase(AudioExts[i]);
RegDeleteValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext + '\OpenWithProgids', argsArray[0]);
RegDeleteValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext + '\OpenWithProgids', ExpandConstant('{#ASSOC_PROG_ID}'));
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext, '', str);
if CompareText(str, argsArray[0]) = 0 then
RegDeleteValue(HKEY_LOCAL_MACHINE, 'Software\Classes\.' + ext, '');
RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Classes\.' + ext, '', str);
if CompareText(str, argsArray[0]) = 0 then
RegDeleteValue(HKEY_CURRENT_USER, 'Software\Classes\.' + ext, '');
RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.' + ext + '\UserChoice', 'Progid', str);
if CompareText(str, argsArray[0]) = 0 then
RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.' + ext + '\UserChoice');
//RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, ExpandConstant('Software\Classes\Applications\{#NAME_EXE_OUT})'));
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, ExpandConstant('Software\Classes\.' + ext + '\OpenWithList\{#NAME_EXE_OUT}'));
end;
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, '{#APP_REG_PATH}\Capabilities');
RegDeleteValue(HKEY_LOCAL_MACHINE, 'Software\RegisteredApplications', '{#ASCC_REG_REGISTERED_APP_NAME}');
RegDeleteValue(HKEY_CLASSES_ROOT, 'Local Settings\Software\Microsoft\Windows\Shell\MuiCache', ExpandConstant('{app}\{#iconsExe}'));
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, ExpandConstant('Software\Classes\.docx\{#ASCC_REG_PREFIX}.Document.12'));
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, ExpandConstant('Software\Classes\.pptx\{#ASCC_REG_PREFIX}.Show.12'));
RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, ExpandConstant('Software\Classes\.xlsx\{#ASCC_REG_PREFIX}.Sheet.12'));
end;