Installer: update French translation

Installer: update French translation

;Defaults (English)
CreateStartShortcut=Create a Start Menu shortcut
NoKaM=The installation wizard detected that you do not have Knights and Merchants: The Peasants Rebellion installed. You must have the original game installed in order to play the KaM Remake.%n%nThe installation will be aborted.
SteamFirstRun=Original KaM installed from Steam needs to be started at least once on the system, in order for KMR installer to be able to detect and verify it.
CantUpdate=The installation wizard was unable to find an existing version of the KaM Remake to be updated. Please download and install the complete installer instead.%n%nThe installation will be aborted.
OpenAL=Do you want the installation wizard to install OpenAL? (Strongly recommended) It is required for sounds to work in the KaM Remake
ViewReadme=View the Readme
DeleteSaves=Do you want to delete all your saved games and the progress of all campaigns as well?
DeleteMaps=Do you want to delete all Maps and Campaigns as well?

;Dutch
dut.CreateStartShortcut=Aanmaken van een start menu snelkoppeling
dut.NoKaM=De installatie wizard heeft gedetecteerd dat Knights and Merchants: The Peasants Rebellion niet is geïnstalleerd. Je moet het originele spel hebben geïnstalleerd om KaM Remake te kunnen spelen.%n%nDe installatie is afgebroken.
dut.SteamFirstRun=Originele KaM geïnstalleerd vanaf Steam moet minstens één keer worden gestart op deze computer, zodat het KMR-installatieprogramma het spel kan detecteren en verifiëren.
dut.CantUpdate=De installatie wizard kon geen bestaande versie vinden van de KaM Remake om deze bij te werken naar de nieuwste versie. Download en installeer de complete versie.%n%nDe installatie is afgebroken
dut.OpenAL=Wil je dat de installatie wizard OpenAL installeerd? (Aan te raden) OpenAL is nodig voor de werking van het geluid in KaM Remake
dut.ViewReadme=Lees de Readme
dut.DeleteSaves=Wil je ook alle opgeslagen spellen en voortgang in de campagnes verwijderen?
dut.DeleteMaps=Wil je ook alle Kaarten en Campagnes verwijderen?

;Swedish
swe.CreateStartShortcut=Skapa en genväg i startmenyn
swe.NoKaM=Det verkar som att du inte har Knights and Merchants: The Peasants Rebellion installerat på din dator.%n%nInstallationen kommer att avbrytas.
swe.CantUpdate=Kunde inte hitta en redan installerad version av KaM Remake att uppdatera. Ladda ner och installera den kompletta versionen istället.%n%nInstallationen kommer att avbrytas.
swe.OpenAL=Vill du även installera OpenAL? (Rekommenderas starkt) Det krävs för att ljud ska fungera i KaM Remake
swe.ViewReadme=Visa Readme-filen

;German
ger.CreateStartShortcut=Verknüpfung im Startmenü erstellen
ger.NoKaM=Setup hat ermittelt, dass Knights and Merchants: The Peasants Rebellion nicht installiert ist.
ger.SteamFirstRun=Das von Steam installierte Original-KaM muss mindestens einmal auf dem System gestartet werden, damit das KMR-Installationsprogramm es erkennen und überprüfen kann.
ger.CantUpdate=Setup war nicht in der Lage eine installierte Version von KaM Remake zu aktualisieren. Bitte lade die Vollversion von KaM Remake herunter und führe das Setup erneut aus.
ger.OpenAL=Soll Setup auch OpenAl installieren (empfohlen)? Es wird für die Soundwiedergabe von KaM Remake benötigt.
ger.ViewReadme=Readme anzeigen
ger.DeleteSaves=Möchten Sie auch alle Ihre gespeicherten Spiele und den Fortschritt aller Kampagnen löschen?
ger.DeleteMaps=Möchten Sie auch alle Karten und Kampagnen löschen?

;Polish
pol.CreateStartShortcut=Stwórz skrót w Menu Start
pol.NoKaM=Kreator instalacji wykrył że nie masz zainstalowanego Knights and Merchants: The Peasants Rebellion.%n%nInstalacja zostanie przerwana.
pol.SteamFirstRun=Gra Knights and Merchants, zakupiona w sklepie Steam, musi zostać uruchomiona przynajmniej raz, aby program instalacyjny Remake był w stanie ją wykryć i zweryfikować.
pol.CantUpdate=Kreator instalacji nie był w stanie znaleźć istniejącej wersji KaM Remake do zaktualizowania. Proszę pobrać i zainstalować kompletny instalator.%n%nInstalacja zostanie przerwana.
pol.OpenAL=Czy chcesz aby kreator instalacji zainstalował OpenAL? (Zalecane) Jest on wymagany by działały dźwięki w KaM Remake.
pol.ViewReadme=Zobacz plik Readme
pol.DeleteSaves=Czy chcesz usunąć wszystkie twoje zapisane gry, jak również postęp wszystkich kampanii?
pol.DeleteMaps=Czy chcesz usunąć również wszystkie mapy oraz kampanie?

;Hungarian
hun.CreateStartShortcut=Start Menü ikon létrehozása
hun.NoKaM=A telepítő nem észlelte a Knights and Merchants: A Parasztfelkelést telepítve.%n%nA telepítés megszakításra kerül.
hun.SteamFirstRun=Steamről telepített KaM esetében az eredeti játékot legalább egyszer futtatni kell, hogy a KaM Remake telepítője felismerje azt.
hun.CantUpdate=A telepítő nem talált KaM Remake verziót a számítógépen, hogy frissítse. Kérem töltse le és használja a teljes telepítőt.%n%nA telepítés megszakításra kerül.
hun.OpenAL=Szeretnéd, hogy a telepítő telepítse az OpenAL-t? (Erősen ajánlott) A hangok működéséhez szükséges a KaM Remake-ben
hun.ViewReadme=Olvass el fájl megtekintése
hun.DeleteSaves=Töröli az összes Mentett játékot és minden Kampány állását is?
hun.DeleteMaps=Töröli az összes Térképet és Kampányt?

;French
fre.CreateStartShortcut=Créer un raccourci dans le menu Démarrer
fre.NoKaM=L'assistant d'installation n'a détecté aucune installation de Knights and Merchants : The Peasants Rebellion.%n%nL'installation sera interrompue.
fre.SteamFirstRun=La version original de KaM installé depuis steam doit avoir été lancé au moins une fois, de façon à ce que l'installateur KMR puisse le détecter et le vérifier.
fre.CantUpdate=L'assistant d'installation n'a détecté aucune version existante de KaM Remake à mettre à jour. Veuillez télécharger et utiliser l'installateur complet.%n%nL'installation sera interrompue.
fre.OpenAL=Voulez-vous que l'assistant d'installation installe OpenAL ? (fortement recommandé) OpenAL est requis pour le fonctionnement audio de KaM Remake.
fre.ViewReadme=Voir le lisez-moi
fre.DeleteSaves=Voulez vous vraiment supprimer toutes vos sauvegardes et progrès dans les campagnes également ?
fre.DeleteMaps=Voulez vous supprimer toutes les cartes et campagnes également ?

;Czech
cze.CreateStartShortcut=Vytvořit zástupce v nabídce Start
cze.NoKaM=Instalátor zjistil, že hra Knights and Merchants: The Peasants Rebellion není nainstalována. Instalace bude nyní ukončena.
cze.SteamFirstRun=Knights and Merchants na Steamu je potřeba pustit alespoň jednou, aby mohla instalace pokračovat.
cze.CantUpdate=Instalátor nenalezl na vašem počítači KaM Remake. Nejprve si stáhněte kompletní KaM Remake, poté můžete aktualizovat. Instalace bude nyní ukončena.
cze.OpenAL=Chcete nainstalovat OpenAL? (Doporučeno) OpenAL je vyžadováno pro správnou funkci zvuku v KaM Remake
cze.ViewReadme=Otevřít Readme
cze.DeleteSaves=Chcete také smazat všechny uložené hry a postup v kampani?
cze.DeleteMaps=Chcete také smazat všechny mapy a kampaně?

;Russian
rus.CreateStartShortcut=Создать ярлык в меню Пуск
rus.NoKaM=Мастер установки не обнаружил установленной игры Knights and Merchants: The Peasants Rebellion. Оригинальная игра необходима для установки КаМ Ремейк.%n%nУстановка будет отменена.
rus.SteamFirstRun=Оригинальная игра, установленная из Steam должна быть запущена хотя бы 1 раз, чтобы данный установщик КаМ Ремейк смог обнаружить и проверить её.
rus.CantUpdate=Мастер установки не смог обнаружить версию КаМ Ремейк для обновления. Пожалуйста скачайте и запустите полную версию установщика.%n%nУстановка будет отменена.
rus.OpenAL=Установить OpenAL? (рекоммендуется) Необходимо для работы звука в КаМ Ремейк
rus.ViewReadme=Показать Readme
rus.DeleteSaves=Вы хотите также удалить все сохраненные игры и прогресс всех кампаний?
rus.DeleteMaps=Вы хотите также удалить все карты и кампании?

;Brazilian Portuguese
ptb.CreateStartShortcut=Criar um atalho no menu Iniciar
ptb.NoKaM=O assistente de instalação detectou que você não tem Knights and Merchants: The Peasants Rebellion instalado.%n%nA instalação será abortada.
ptb.CantUpdate=O assistente de instalação foi incapaz de encontrar uma versão existente do KaM Remake para atualizar. Por favor, baixe e instale através do instalador completo.%n%nA instalação será abortada.
ptb.OpenAL=Você deseja que o assistente de instalação instale o OpenAL? (Altamente recomendado) É necessário para o funcionamento dos sons no KaM Remake
ptb.ViewReadme=Ver o Readme

;Italian
ita.CreateStartShortcut=Crea collegamento nel Menu Avvio
ita.NoKaM=La procedura guidata di installazione non ha rilevato alcuna copia di "Knights and Merchants: The Peasants Rebellion". È necessaria l'installazione del gioco originale per poter utilizzare "KaM Remake".%n%nLa procedura di installazione verrà ora annullata.
ita.CantUpdate=La procedura guidata di installazione non ha rilevato alcuna versione di "KaM Remake" da aggiornare. Si prega di scaricare e utilizzare invece il programma di installazione completo.%n%nLa procedura di installazione verrà ora annullata.
ita.OpenAL=Vuoi procedere all'installazione di OpenAL? (Fortemente raccomandata) È necessaria per il corretto funzionamento dell'audio in "KaM Remake"
ita.ViewReadme=Visualizza il file Readme

;Spanish
spa.CreateStartShortcut=Crea un acceso directo en el menú de inicio
spa.NoKaM=El asistente de instalación ha detectado que no tienes Knights and Merchants: The Peasants Rebellion instalado. Usted debe tener instalado el juego original para poder jugar el remake de Kam.%n%nLa instalación se interrumpirá
spa.SteamFirstRun=El KaM original instalado desde Steam debe iniciarse al menos una vez en el sistema para que el instalador de KMR pueda detectarlo y verificarlo.
spa.CantUpdate=El asistente de instalación no ha podido encontrar la versión Kam Remake para poder actualizar. Por favor, descarga y instala la versión completa.%n%nLa instalación se interrumpirá.
spa.OpenAL=¿Quieres que el asistente de instalación instale OpenAL? (Muy recomendable) se requiere para el sonido del juego Kam Remake
spa.ViewReadme=Ver el archivo Readme
spa.DeleteSaves=¿Quieres eliminar todas tus partidas guardadas y el progreso de todas las campañas también?
spa.DeleteMaps=¿Quieres eliminar también todos los mapas y campañas?

;Bulgarian
bul.CreateStartShortcut=Създай пряк път
bul.NoKaM=Инсталацията откри, че нямате инсталирана Knights and Merchants: The Peasants Rebellion. Вие трябва да имате Knights and Merchants: The Peasants Rebellion, за да играете KaM Remake.%n%nИнсталацията се прекратява.
bul.CantUpdate=Инсталацията не успя да намери съществуваща версия на KaM Remake, за да бъде подобрена. Моля изтеглете и инсталирайте пълния инсталатор.%n%nИнсталацията ще се прекрати.
bul.OpenAL=Искате ли инсталацията да инсталира OpenAL? (Силно се препоръчва) Нужно е, за да работи звука в играта.
bul.ViewReadme=Виж "Прочети ме"

;Estonian
est.CreateStartShortcut=Loo start menüü otsetee
est.NoKaM=Paigaldamise programm on avastanud, et Teil ei ole paigaldatud Knights and Merchants: The Peasants Rebellion. Teil peab olema paigaldatud originaal mäng, et mängida mängu KaM Remake.%n%nPaigaldamine katkestakase.
est.CantUpdate=Paigaldamise programm ei leidnud olemas olevat KaM Remake versiooni, mida uuendada. Palun laadige internetist alla täis versioon mängust KaM Remake.%n%nPaigaldamine katkestatakse.
est.OpenAL=Kas te soovite paigaldada programmi OpenAL? (Tungivalt soovitatav) See on vajalik, et helid töötaksid mängus KaM Remake.
est.ViewReadme=Vaadake faili Readme

;Slovak
svk.CreateStartShortcut=Vytvoriť zástupcu v ponuke Štart
svk.NoKaM=Sprievodca inštaláciou zistil, že nemáte nainštalovaný Knight & Merchants: The Peasants Rebellion. Musíte mať nainštalovanú originálnu hru, aby ste mohli hrať KaM Remake.%n%nInštalácia bude prerušená.
svk.CantUpdate=Sprievodca inštaláciou nemohol nájsť existujúcu verziu KaM Remake, je ju potrebné aktualizovať. Prosím, stiahnite a nainštalujte kompletnú inštaláciu.%n%nInštalácia bude prerušená.
svk.OpenAL=Chcete použiť spriveodcu na inštaláciu OpenAL? (Dôrazne odporúčané). Je to potrebné pre zvuky v hre v KAM Remake.
svk.ViewReadme=Pozri súbor Readme

;Romanian
rom.CreateStartShortcut=Creează o scurtătura în meniul de Start
rom.NoKaM=Instalarea a detectat ca nu ai instalat Knights and Merchants: The Peasants Rebellion. Trebuie să ai instalat jocul original pentru a putea juca KaM Remake.%n%nInstalarea se va întrerupe.
rom.CantUpdate=Instalarea nu a putut găsi o versiune care va putea fi updată. Te rog să downloadezi fisierul de instalare complet.%n%nInstalarea se va întrerupe.
rom.OpenAL=Vrei să instalezi OpenAL?(Recomandat) Este necesar pentru sunetele din KaM Remake
rom.ViewReadme=Vizualizeazp fisierul Citeste-ma

;Ukrainian
ukr.CreateStartShortcut=Створити ярлик стартового меню
ukr.NoKaM=Майстер встановлення программи не знайшов оригіналу Knights and Merchants: The Peasants Rebellion на вашому комп`ютері. Ви маєте встановити оригінал для того , щоб грат в KaM Remake.%n%nІнсталяцію скасовано.
ukr.CantUpdate=Майстер встановлення програми не зміг знайти KaM Remake на компютері для того, щоб оновити його. Будь ласка , в першу чергу , завантажте і встановіть повну версію перш ніж встановлювати апдейт.%n%nІнсталяцію скасовано.
ukr.OpenAL=Чи хочете ви щоби майстер встановив OpenAL? (Дуже рекомендується) Він необхідний для роботи звуку у KaM Remake
ukr.ViewReadme=Відкрити Readme

;Norwegian
nor.CreateStartShortcut=Legg til snarvei i Start-menyen
nor.NoKaM=Installasjonsveiviseren oppdaget at du ikke har Knights and Merchants: The Peasants Rebellion installert. Du må ha det originale spillet installert for å spille KaM Remake.%n%nInstallasjonen vil bli avbrutt.
nor.CantUpdate=Installasjonen kunne ikke finne en eksisterende versjon av KaM Remake å oppdatere. Vennligst last ned og installer det fullstendige installasjonsprogrammet i stedet.%n%nInstallasjonen vil bli avbrutt.
nor.OpenAL=Ønsker du at installasjonsveiviseren skal installere OpenAL? (Anbefales sterkt) Det er nødvendig for at lyder skal fungere i KaM Remake
nor.ViewReadme=Vis Readme

;Belarusian
bel.CreateStartShortcut=Стварыць цэтлік ў меню "Пуск"
bel.NoKaM=Майстар ўстаноўкі выявіў што ў вас няма ўсталяванай iгры Knights and Merchants: The Peasants Rebellion. Вы павінны ўсталяваць арыгінальную iгру каб іграць ў KaM Remake.%n%nУстаноўка будзе спынена.
bel.CantUpdate=Майстру ўстаноўкі не ўдаецца знайсці версію KaM Remake для абнаўлення. Калі ласка загрузіце поўны пакет ўстаноўкі.%n%nУстаноўка будзе спынена.
bel.OpenAL=Вы хочаце ўсталяваць OpenAL? (настойліва рэкамендуецца) Гэта неабходна для работы гуку ў KaM Remake
bel.ViewReadme=Адкрыць Readme

;Japanese
jpn.CreateStartShortcut=スタートメニューのショートカットが作成されます。
jpn.NoKaM=インストールウィザードが"Knights and Merchants: The Peasants Rebellion"をインストールしていないの検出されました。KAM リメイクがフレーされるにはオリジナルのゲームはインストールしてはいけません。インストールは中止されました。
jpn.CantUpdate=インストールウィザードは既存のKAMリメイクバージョンが見つかりませんでした。その代わりに全部のインストーラはダウンロートしてインストールしてください。インストールは中止されました。
jpn.OpenAL=インストールウィザードがOpenALをインストールしたいですか「強い推奨」。KAM リメイクの音楽などを聞くと必要です。
jpn.ViewReadme=Readmeが表示されます。

;Turkish
tur.CreateStartShortcut=Başlat menüsü kısayolu oluştur.
tur.NoKaM=Kurulum sihirbazı orijinal Knights and Merchants: The Peasants Rebellion oyununun kurulu olmadığını tespit etti. KaM Remake modunu oynayabilmek için orijinal oyuna sahip olmanız gerekmektedir.%n%nKurulum sihirbazı kapanacaktır.
tur.CantUpdate=Kurulum sihirbazı herhangi bir kurulu KaM Remake versiyonu bulamadı. Lütfen complete installer indirerek kurulum yapınız.%n%nKurulum sihirbazı kapanacaktır.
tur.OpenAL=Kurulum sihirbazının OpenAL kurmasını ister misiniz? (Tavsiye edilir) Seslerin oyun içinde çalışması için gereklidir.
tur.ViewReadme=Beni oku dosyasını aç

;Korean
kor.CreateStartShortcut=시작 메뉴 단축 아이콘 만들기
kor.NoKaM=설치 마법사가 '기사와 상인:농민의 반란'이 설치가 안된것으로 확인되었습니다. '기사와 상인 다시만듬'을 실행하기 위해서는 반드시 원본 게임이 설치되어 있어야 합니다. 설치가 중단 됩니다.
kor.CantUpdate=설치 마법사가 갱신할 '기사와 상인 다시만듬'의 기존 버전을 찾을 수 없습니다. 전체 설치 프로그램 대신에 다운로드하여 설치 해주십시오. 설치가 중단 됩니다.
kor.OpenAL=OpenAL을 설치하기위해 설치 마법사가 필요합니까? (강력하게 추천함) '기사와 상인 다시만듬'에서 소리를 작동하는데 필요합니다.
kor.ViewReadme=읽어보기

;Serbian
srb.CreateStartShortcut=Направите Старт Мену Пречицу
srb.NoKaM=Инсталациони чаробњак је приметио да немате Knights and Merchants: The Peasants Rebellion инсталирано. Морате имати оригиналну игру инсталирану да бисте играли KaM Remake.%n%nИнсталације ће престати са радом.
srb.CantUpdate=Инсталациони чаробњак није могао да нађе постојећу верзију KaM Remake да се усавремени. Молимо вас скините и инсталирајте комплетан инсталер уместо тога.%n%nИнсталација ће престати са радом.
srb.OpenAL=Да ли желите да вам инсталациони чаробњакисталира OpenAL? (Врло препоручљиво) Потребно је да бих ѕвукови радили у KaM Remake.
srb.ViewReadme=Прочитајте Реадме

;Chinese
chn.CreateStartShortcut=创建开始菜单快捷方式
chn.NoKaM=安装向导检测到没有《骑士与商人之农民起义》的安装。为了能玩重制版游戏，必须先安装原版游戏。本安装程序将被终止。
chn.CantUpdate=安装向导无法找到一个存在的重制版能够被升级。请重新下载并安装完整的安装包。本安装程序将被终止。
chn.OpenAL=你想用安装向导来安装OpenAL吗？（强烈推荐）这是音效文件运行的必需程序。
chn.ViewReadme=查看自述文件

;Slovenian
slv.CreateStartShortcut=Ustvari bljižnico na meniju
slv.NoKaM=Čarovnik za namestitev je zaznal da nimate nameščeno igro Knights and Merchants: The Peasants Rebellion. Morate imeti nameščeno originalno igro če želite igrati KaM Remake.%n%nNamestitev bo prekinjena
slv.OpenAL=Ali želite namestiti OpenAL? (Močno priporočeno) potrebno je za elovanje zvokov v igri KaM Remake.
slv.ViewReadme=Poglej si opis

;Finnish
fin.CreateStartShortcut=Luo käynnistysvalikon pikakuvake
fin.NoKaM=Asennusohjelma ei havainnut olemassaolevaa asennusta pelistä Knights and Merchants: The Peasants Rebellion. Sinulla täytyy olla alkuperäinen peli asennettuna jotta voit asentaa KaM Remaken.%n%nAsennus keskeytetään
fin.SteamFirstRun=Alkuperäinen KaM-asennus Steamista täytyy käynnistää kerran ennenkuin KMR-asennusohjelma pystyy löytämään ja varmistamaan sen.
fin.CantUpdate=Asennusohjelma ei löytänyt olemassa olevaa versiota Kam Remakesta päivitystä varten. Lataa ja asenna koko asennusohjelma.%n%nAsennus keskeytetään
fin.OpenAL=Haluatko että asennusohjelma asentaa OpenAL:in? (Vahva suositus) Tämä vaaditaan jotta äänet toimisivat.
fin.ViewReadme=Tarkastele LueMinut
fin.DeleteSaves=Haluatko varmasti poistaa tallennuksesi ja etenemisesi kaikista kampanjoista?
fin.DeleteMaps=Haluatko varmasti poistaa kaikki Kartat ja Kampanjat?

;Defaults (English)
CreateStartShortcut=Create a Start Menu shortcut
NoKaM=The installation wizard detected that you do not have Knights and Merchants: The Peasants Rebellion installed. You must have the original game installed in order to play the KaM Remake.%n%nThe installation will be aborted.
SteamFirstRun=Original KaM installed from Steam needs to be started at least once on the system, in order for KMR installer to be able to detect and verify it.
CantUpdate=The installation wizard was unable to find an existing version of the KaM Remake to be updated. Please download and install the complete installer instead.%n%nThe installation will be aborted.
OpenAL=Do you want the installation wizard to install OpenAL? (Strongly recommended) It is required for sounds to work in the KaM Remake
ViewReadme=View the Readme
DeleteSaves=Do you want to delete all your saved games and the progress of all campaigns as well?
DeleteMaps=Do you want to delete all Maps and Campaigns as well?

;Dutch
dut.CreateStartShortcut=Aanmaken van een start menu snelkoppeling
dut.NoKaM=De installatie wizard heeft gedetecteerd dat Knights and Merchants: The Peasants Rebellion niet is geïnstalleerd. Je moet het originele spel hebben geïnstalleerd om KaM Remake te kunnen spelen.%n%nDe installatie is afgebroken.
dut.SteamFirstRun=Originele KaM geïnstalleerd vanaf Steam moet minstens één keer worden gestart op deze computer, zodat het KMR-installatieprogramma het spel kan detecteren en verifiëren.
dut.CantUpdate=De installatie wizard kon geen bestaande versie vinden van de KaM Remake om deze bij te werken naar de nieuwste versie. Download en installeer de complete versie.%n%nDe installatie is afgebroken
dut.OpenAL=Wil je dat de installatie wizard OpenAL installeerd? (Aan te raden) OpenAL is nodig voor de werking van het geluid in KaM Remake
dut.ViewReadme=Lees de Readme
dut.DeleteSaves=Wil je ook alle opgeslagen spellen en voortgang in de campagnes verwijderen?
dut.DeleteMaps=Wil je ook alle Kaarten en Campagnes verwijderen?

;Swedish
swe.CreateStartShortcut=Skapa en genväg i startmenyn
swe.NoKaM=Det verkar som att du inte har Knights and Merchants: The Peasants Rebellion installerat på din dator.%n%nInstallationen kommer att avbrytas.
swe.CantUpdate=Kunde inte hitta en redan installerad version av KaM Remake att uppdatera. Ladda ner och installera den kompletta versionen istället.%n%nInstallationen kommer att avbrytas.
swe.OpenAL=Vill du även installera OpenAL? (Rekommenderas starkt) Det krävs för att ljud ska fungera i KaM Remake
swe.ViewReadme=Visa Readme-filen

;German
ger.CreateStartShortcut=Verknüpfung im Startmenü erstellen
ger.NoKaM=Setup hat ermittelt, dass Knights and Merchants: The Peasants Rebellion nicht installiert ist.
ger.SteamFirstRun=Das von Steam installierte Original-KaM muss mindestens einmal auf dem System gestartet werden, damit das KMR-Installationsprogramm es erkennen und überprüfen kann.
ger.CantUpdate=Setup war nicht in der Lage eine installierte Version von KaM Remake zu aktualisieren. Bitte lade die Vollversion von KaM Remake herunter und führe das Setup erneut aus.
ger.OpenAL=Soll Setup auch OpenAl installieren (empfohlen)? Es wird für die Soundwiedergabe von KaM Remake benötigt.
ger.ViewReadme=Readme anzeigen
ger.DeleteSaves=Möchten Sie auch alle Ihre gespeicherten Spiele und den Fortschritt aller Kampagnen löschen?
ger.DeleteMaps=Möchten Sie auch alle Karten und Kampagnen löschen?

;Polish
pol.CreateStartShortcut=Stwórz skrót w Menu Start
pol.NoKaM=Kreator instalacji wykrył że nie masz zainstalowanego Knights and Merchants: The Peasants Rebellion.%n%nInstalacja zostanie przerwana.
pol.SteamFirstRun=Gra Knights and Merchants, zakupiona w sklepie Steam, musi zostać uruchomiona przynajmniej raz, aby program instalacyjny Remake był w stanie ją wykryć i zweryfikować.
pol.CantUpdate=Kreator instalacji nie był w stanie znaleźć istniejącej wersji KaM Remake do zaktualizowania. Proszę pobrać i zainstalować kompletny instalator.%n%nInstalacja zostanie przerwana.
pol.OpenAL=Czy chcesz aby kreator instalacji zainstalował OpenAL? (Zalecane) Jest on wymagany by działały dźwięki w KaM Remake.
pol.ViewReadme=Zobacz plik Readme
pol.DeleteSaves=Czy chcesz usunąć wszystkie twoje zapisane gry, jak również postęp wszystkich kampanii?
pol.DeleteMaps=Czy chcesz usunąć również wszystkie mapy oraz kampanie?

;Hungarian
hun.CreateStartShortcut=Start Menü ikon létrehozása
hun.NoKaM=A telepítő nem észlelte a Knights and Merchants: A Parasztfelkelést telepítve.%n%nA telepítés megszakításra kerül.
hun.SteamFirstRun=Steamről telepített KaM esetében az eredeti játékot legalább egyszer futtatni kell, hogy a KaM Remake telepítője felismerje azt.
hun.CantUpdate=A telepítő nem talált KaM Remake verziót a számítógépen, hogy frissítse. Kérem töltse le és használja a teljes telepítőt.%n%nA telepítés megszakításra kerül.
hun.OpenAL=Szeretnéd, hogy a telepítő telepítse az OpenAL-t? (Erősen ajánlott) A hangok működéséhez szükséges a KaM Remake-ben
hun.ViewReadme=Olvass el fájl megtekintése
hun.DeleteSaves=Töröli az összes Mentett játékot és minden Kampány állását is?
hun.DeleteMaps=Töröli az összes Térképet és Kampányt?

;French
fre.CreateStartShortcut=Créer un raccourci dans le menu Démarrer
fre.NoKaM=L'assistant d'installation n'a détecté aucune installation de Knights and Merchants : The Peasants Rebellion.%n%nL'installation sera interrompue.
fre.CantUpdate=L'assistant d'installation n'a détecté aucune version existante de KaM Remake à mettre à jour. Veuillez télécharger et utiliser l'installateur complet.%n%nL'installation sera interrompue.
fre.OpenAL=Voulez-vous que l'assistant d'installation installe OpenAL ? (fortement recommandé) OpenAL est requis pour le fonctionnement audio de KaM Remake.
fre.ViewReadme=Voir le lisez-moi

;Czech
cze.CreateStartShortcut=Vytvořit zástupce v nabídce Start
cze.NoKaM=Instalátor zjistil, že hra Knights and Merchants: The Peasants Rebellion není nainstalována. Instalace bude nyní ukončena.
cze.SteamFirstRun=Knights and Merchants na Steamu je potřeba pustit alespoň jednou, aby mohla instalace pokračovat.
cze.CantUpdate=Instalátor nenalezl na vašem počítači KaM Remake. Nejprve si stáhněte kompletní KaM Remake, poté můžete aktualizovat. Instalace bude nyní ukončena.
cze.OpenAL=Chcete nainstalovat OpenAL? (Doporučeno) OpenAL je vyžadováno pro správnou funkci zvuku v KaM Remake
cze.ViewReadme=Otevřít Readme
cze.DeleteSaves=Chcete také smazat všechny uložené hry a postup v kampani?
cze.DeleteMaps=Chcete také smazat všechny mapy a kampaně?

;Russian
rus.CreateStartShortcut=Создать ярлык в меню Пуск
rus.NoKaM=Мастер установки не обнаружил установленной игры Knights and Merchants: The Peasants Rebellion. Оригинальная игра необходима для установки КаМ Ремейк.%n%nУстановка будет отменена.
rus.SteamFirstRun=Оригинальная игра, установленная из Steam должна быть запущена хотя бы 1 раз, чтобы данный установщик КаМ Ремейк смог обнаружить и проверить её.
rus.CantUpdate=Мастер установки не смог обнаружить версию КаМ Ремейк для обновления. Пожалуйста скачайте и запустите полную версию установщика.%n%nУстановка будет отменена.
rus.OpenAL=Установить OpenAL? (рекоммендуется) Необходимо для работы звука в КаМ Ремейк
rus.ViewReadme=Показать Readme
rus.DeleteSaves=Вы хотите также удалить все сохраненные игры и прогресс всех кампаний?
rus.DeleteMaps=Вы хотите также удалить все карты и кампании?

;Brazilian Portuguese
ptb.CreateStartShortcut=Criar um atalho no menu Iniciar
ptb.NoKaM=O assistente de instalação detectou que você não tem Knights and Merchants: The Peasants Rebellion instalado.%n%nA instalação será abortada.
ptb.CantUpdate=O assistente de instalação foi incapaz de encontrar uma versão existente do KaM Remake para atualizar. Por favor, baixe e instale através do instalador completo.%n%nA instalação será abortada.
ptb.OpenAL=Você deseja que o assistente de instalação instale o OpenAL? (Altamente recomendado) É necessário para o funcionamento dos sons no KaM Remake
ptb.ViewReadme=Ver o Readme

;Italian
ita.CreateStartShortcut=Crea collegamento nel Menu Avvio
ita.NoKaM=La procedura guidata di installazione non ha rilevato alcuna copia di "Knights and Merchants: The Peasants Rebellion". È necessaria l'installazione del gioco originale per poter utilizzare "KaM Remake".%n%nLa procedura di installazione verrà ora annullata.
ita.CantUpdate=La procedura guidata di installazione non ha rilevato alcuna versione di "KaM Remake" da aggiornare. Si prega di scaricare e utilizzare invece il programma di installazione completo.%n%nLa procedura di installazione verrà ora annullata.
ita.OpenAL=Vuoi procedere all'installazione di OpenAL? (Fortemente raccomandata) È necessaria per il corretto funzionamento dell'audio in "KaM Remake"
ita.ViewReadme=Visualizza il file Readme

;Spanish
spa.CreateStartShortcut=Crea un acceso directo en el menú de inicio
spa.NoKaM=El asistente de instalación ha detectado que no tienes Knights and Merchants: The Peasants Rebellion instalado. Usted debe tener instalado el juego original para poder jugar el remake de Kam.%n%nLa instalación se interrumpirá
spa.SteamFirstRun=El KaM original instalado desde Steam debe iniciarse al menos una vez en el sistema para que el instalador de KMR pueda detectarlo y verificarlo.
spa.CantUpdate=El asistente de instalación no ha podido encontrar la versión Kam Remake para poder actualizar. Por favor, descarga y instala la versión completa.%n%nLa instalación se interrumpirá.
spa.OpenAL=¿Quieres que el asistente de instalación instale OpenAL? (Muy recomendable) se requiere para el sonido del juego Kam Remake
spa.ViewReadme=Ver el archivo Readme
spa.DeleteSaves=¿Quieres eliminar todas tus partidas guardadas y el progreso de todas las campañas también?
spa.DeleteMaps=¿Quieres eliminar también todos los mapas y campañas?

;Bulgarian
bul.CreateStartShortcut=Създай пряк път
bul.NoKaM=Инсталацията откри, че нямате инсталирана Knights and Merchants: The Peasants Rebellion. Вие трябва да имате Knights and Merchants: The Peasants Rebellion, за да играете KaM Remake.%n%nИнсталацията се прекратява.
bul.CantUpdate=Инсталацията не успя да намери съществуваща версия на KaM Remake, за да бъде подобрена. Моля изтеглете и инсталирайте пълния инсталатор.%n%nИнсталацията ще се прекрати.
bul.OpenAL=Искате ли инсталацията да инсталира OpenAL? (Силно се препоръчва) Нужно е, за да работи звука в играта.
bul.ViewReadme=Виж "Прочети ме"

;Estonian
est.CreateStartShortcut=Loo start menüü otsetee
est.NoKaM=Paigaldamise programm on avastanud, et Teil ei ole paigaldatud Knights and Merchants: The Peasants Rebellion. Teil peab olema paigaldatud originaal mäng, et mängida mängu KaM Remake.%n%nPaigaldamine katkestakase.
est.CantUpdate=Paigaldamise programm ei leidnud olemas olevat KaM Remake versiooni, mida uuendada. Palun laadige internetist alla täis versioon mängust KaM Remake.%n%nPaigaldamine katkestatakse.
est.OpenAL=Kas te soovite paigaldada programmi OpenAL? (Tungivalt soovitatav) See on vajalik, et helid töötaksid mängus KaM Remake.
est.ViewReadme=Vaadake faili Readme

;Slovak
svk.CreateStartShortcut=Vytvoriť zástupcu v ponuke Štart
svk.NoKaM=Sprievodca inštaláciou zistil, že nemáte nainštalovaný Knight & Merchants: The Peasants Rebellion. Musíte mať nainštalovanú originálnu hru, aby ste mohli hrať KaM Remake.%n%nInštalácia bude prerušená.
svk.CantUpdate=Sprievodca inštaláciou nemohol nájsť existujúcu verziu KaM Remake, je ju potrebné aktualizovať. Prosím, stiahnite a nainštalujte kompletnú inštaláciu.%n%nInštalácia bude prerušená.
svk.OpenAL=Chcete použiť spriveodcu na inštaláciu OpenAL? (Dôrazne odporúčané). Je to potrebné pre zvuky v hre v KAM Remake.
svk.ViewReadme=Pozri súbor Readme

;Romanian
rom.CreateStartShortcut=Creează o scurtătura în meniul de Start
rom.NoKaM=Instalarea a detectat ca nu ai instalat Knights and Merchants: The Peasants Rebellion. Trebuie să ai instalat jocul original pentru a putea juca KaM Remake.%n%nInstalarea se va întrerupe.
rom.CantUpdate=Instalarea nu a putut găsi o versiune care va putea fi updată. Te rog să downloadezi fisierul de instalare complet.%n%nInstalarea se va întrerupe.
rom.OpenAL=Vrei să instalezi OpenAL?(Recomandat) Este necesar pentru sunetele din KaM Remake
rom.ViewReadme=Vizualizeazp fisierul Citeste-ma

;Ukrainian
ukr.CreateStartShortcut=Створити ярлик стартового меню
ukr.NoKaM=Майстер встановлення программи не знайшов оригіналу Knights and Merchants: The Peasants Rebellion на вашому комп`ютері. Ви маєте встановити оригінал для того , щоб грат в KaM Remake.%n%nІнсталяцію скасовано.
ukr.CantUpdate=Майстер встановлення програми не зміг знайти KaM Remake на компютері для того, щоб оновити його. Будь ласка , в першу чергу , завантажте і встановіть повну версію перш ніж встановлювати апдейт.%n%nІнсталяцію скасовано.
ukr.OpenAL=Чи хочете ви щоби майстер встановив OpenAL? (Дуже рекомендується) Він необхідний для роботи звуку у KaM Remake
ukr.ViewReadme=Відкрити Readme

;Norwegian
nor.CreateStartShortcut=Legg til snarvei i Start-menyen
nor.NoKaM=Installasjonsveiviseren oppdaget at du ikke har Knights and Merchants: The Peasants Rebellion installert. Du må ha det originale spillet installert for å spille KaM Remake.%n%nInstallasjonen vil bli avbrutt.
nor.CantUpdate=Installasjonen kunne ikke finne en eksisterende versjon av KaM Remake å oppdatere. Vennligst last ned og installer det fullstendige installasjonsprogrammet i stedet.%n%nInstallasjonen vil bli avbrutt.
nor.OpenAL=Ønsker du at installasjonsveiviseren skal installere OpenAL? (Anbefales sterkt) Det er nødvendig for at lyder skal fungere i KaM Remake
nor.ViewReadme=Vis Readme

;Belarusian
bel.CreateStartShortcut=Стварыць цэтлік ў меню "Пуск"
bel.NoKaM=Майстар ўстаноўкі выявіў што ў вас няма ўсталяванай iгры Knights and Merchants: The Peasants Rebellion. Вы павінны ўсталяваць арыгінальную iгру каб іграць ў KaM Remake.%n%nУстаноўка будзе спынена.
bel.CantUpdate=Майстру ўстаноўкі не ўдаецца знайсці версію KaM Remake для абнаўлення. Калі ласка загрузіце поўны пакет ўстаноўкі.%n%nУстаноўка будзе спынена.
bel.OpenAL=Вы хочаце ўсталяваць OpenAL? (настойліва рэкамендуецца) Гэта неабходна для работы гуку ў KaM Remake
bel.ViewReadme=Адкрыць Readme

;Japanese
jpn.CreateStartShortcut=スタートメニューのショートカットが作成されます。
jpn.NoKaM=インストールウィザードが"Knights and Merchants: The Peasants Rebellion"をインストールしていないの検出されました。KAM リメイクがフレーされるにはオリジナルのゲームはインストールしてはいけません。インストールは中止されました。
jpn.CantUpdate=インストールウィザードは既存のKAMリメイクバージョンが見つかりませんでした。その代わりに全部のインストーラはダウンロートしてインストールしてください。インストールは中止されました。
jpn.OpenAL=インストールウィザードがOpenALをインストールしたいですか「強い推奨」。KAM リメイクの音楽などを聞くと必要です。
jpn.ViewReadme=Readmeが表示されます。

;Turkish
tur.CreateStartShortcut=Başlat menüsü kısayolu oluştur.
tur.NoKaM=Kurulum sihirbazı orijinal Knights and Merchants: The Peasants Rebellion oyununun kurulu olmadığını tespit etti. KaM Remake modunu oynayabilmek için orijinal oyuna sahip olmanız gerekmektedir.%n%nKurulum sihirbazı kapanacaktır.
tur.CantUpdate=Kurulum sihirbazı herhangi bir kurulu KaM Remake versiyonu bulamadı. Lütfen complete installer indirerek kurulum yapınız.%n%nKurulum sihirbazı kapanacaktır.
tur.OpenAL=Kurulum sihirbazının OpenAL kurmasını ister misiniz? (Tavsiye edilir) Seslerin oyun içinde çalışması için gereklidir.
tur.ViewReadme=Beni oku dosyasını aç

;Korean
kor.CreateStartShortcut=시작 메뉴 단축 아이콘 만들기
kor.NoKaM=설치 마법사가 '기사와 상인:농민의 반란'이 설치가 안된것으로 확인되었습니다. '기사와 상인 다시만듬'을 실행하기 위해서는 반드시 원본 게임이 설치되어 있어야 합니다. 설치가 중단 됩니다.
kor.CantUpdate=설치 마법사가 갱신할 '기사와 상인 다시만듬'의 기존 버전을 찾을 수 없습니다. 전체 설치 프로그램 대신에 다운로드하여 설치 해주십시오. 설치가 중단 됩니다.
kor.OpenAL=OpenAL을 설치하기위해 설치 마법사가 필요합니까? (강력하게 추천함) '기사와 상인 다시만듬'에서 소리를 작동하는데 필요합니다.
kor.ViewReadme=읽어보기

;Serbian
srb.CreateStartShortcut=Направите Старт Мену Пречицу
srb.NoKaM=Инсталациони чаробњак је приметио да немате Knights and Merchants: The Peasants Rebellion инсталирано. Морате имати оригиналну игру инсталирану да бисте играли KaM Remake.%n%nИнсталације ће престати са радом.
srb.CantUpdate=Инсталациони чаробњак није могао да нађе постојећу верзију KaM Remake да се усавремени. Молимо вас скините и инсталирајте комплетан инсталер уместо тога.%n%nИнсталација ће престати са радом.
srb.OpenAL=Да ли желите да вам инсталациони чаробњакисталира OpenAL? (Врло препоручљиво) Потребно је да бих ѕвукови радили у KaM Remake.
srb.ViewReadme=Прочитајте Реадме

;Chinese
chn.CreateStartShortcut=创建开始菜单快捷方式
chn.NoKaM=安装向导检测到没有《骑士与商人之农民起义》的安装。为了能玩重制版游戏，必须先安装原版游戏。本安装程序将被终止。
chn.CantUpdate=安装向导无法找到一个存在的重制版能够被升级。请重新下载并安装完整的安装包。本安装程序将被终止。
chn.OpenAL=你想用安装向导来安装OpenAL吗？（强烈推荐）这是音效文件运行的必需程序。
chn.ViewReadme=查看自述文件

;Slovenian
slv.CreateStartShortcut=Ustvari bljižnico na meniju
slv.NoKaM=Čarovnik za namestitev je zaznal da nimate nameščeno igro Knights and Merchants: The Peasants Rebellion. Morate imeti nameščeno originalno igro če želite igrati KaM Remake.%n%nNamestitev bo prekinjena
slv.OpenAL=Ali želite namestiti OpenAL? (Močno priporočeno) potrebno je za elovanje zvokov v igri KaM Remake.
slv.ViewReadme=Poglej si opis

;Finnish
fin.CreateStartShortcut=Luo käynnistysvalikon pikakuvake
fin.NoKaM=Asennusohjelma ei havainnut olemassaolevaa asennusta pelistä Knights and Merchants: The Peasants Rebellion. Sinulla täytyy olla alkuperäinen peli asennettuna jotta voit asentaa KaM Remaken.%n%nAsennus keskeytetään
fin.SteamFirstRun=Alkuperäinen KaM-asennus Steamista täytyy käynnistää kerran ennenkuin KMR-asennusohjelma pystyy löytämään ja varmistamaan sen.
fin.CantUpdate=Asennusohjelma ei löytänyt olemassa olevaa versiota Kam Remakesta päivitystä varten. Lataa ja asenna koko asennusohjelma.%n%nAsennus keskeytetään
fin.OpenAL=Haluatko että asennusohjelma asentaa OpenAL:in? (Vahva suositus) Tämä vaaditaan jotta äänet toimisivat.
fin.ViewReadme=Tarkastele LueMinut
fin.DeleteSaves=Haluatko varmasti poistaa tallennuksesi ja etenemisesi kaikista kampanjoista?
fin.DeleteMaps=Haluatko varmasti poistaa kaikki Kartat ja Kampanjat?


(bluefox) check nodex86 and nodex64

(bluefox) check nodex86 and nodex64

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "ioBroker automation platform"
#define MyAppShortName "ioBroker"
#define MyAppLCShortName "iobroker"
#define MyAppVersion "@@version"
#define MyAppPublisher "ioBroker.net"
#define MyAppURL "http://ioBroker.net/"
#define MyAppIcon "ioBroker.ico"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{97DA02F5-2E8C-4B96-BB42-61ED2BBF34DF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={drive:{pf}}\ioBroker
;DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=..\..\delivery
OutputBaseFilename={#MyAppShortName}Installer.{#MyAppVersion}
SetupIconFile={#MyAppIcon}
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=yes
ArchitecturesInstallIn64BitMode=x64
UninstallDisplayIcon={app}\{#MyAppIcon}
CloseApplications=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german";  MessagesFile: "compiler:Languages\German.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

; enable scripting to force admin mode
[Registry]
Root: HKLM; Subkey: "Software\Microsoft\Windows Script Host\Settings"; ValueType: dword; ValueName: "Enabled"; ValueData: "00000001"

[Files]
Source: "nodejs\node.msi"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
Source: "nodejs\node-x64.msi"; DestDir: "{app}"; DestName: "node.msi"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
;Source: "redis-v2.4.6\redis-2.4.6-setup-32-bit.exe"; DestDir: "{app}"; DestName: "redisSetup.exe"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
;Source: "redis-v2.4.6\redis-2.4.6-setup-64-bit.exe"; DestDir: "{app}"; DestName: "redisSetup.exe"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
;Source: "couchDB\couchDBsetup.exe"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall;
;Source: "*.js"; DestDir: "{app}"; Flags: ignoreversion
;Source: "install.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "package.json"; DestDir: "{app}"; Flags: ignoreversion
;Source: "npm.cmd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppIcon}"; DestDir: "{app}"; Flags: ignoreversion
;Source: "..\.windows-ready\data\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "node_modules\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppShortName} Settings"; Filename: "http://localhost:8081"; IconFilename: "{app}\{#MyAppIcon}"
Name: "{group}\{#MyAppShortName} Uninstall"; Filename: "{uninstallexe}"
Name: "{group}\Start {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "start"
Name: "{group}\Stop {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "stop"
Name: "{group}\Restart {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "restart"

[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  ResultCode: integer;
begin
  Result := '';
  if FileExists(ExpandConstant('{app}\serviceIoBroker.bat')) then begin
     Exec(ExpandConstant('{app}\serviceIoBroker.bat'), 'stop', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
end;

function FileReplaceString(const FileName, SearchString, ReplaceString: string):boolean;
var
  MyFile : TStrings;
  MyText : string;
begin
  MyFile := TStringList.Create;

  try
    result := true;

    try
      MyFile.LoadFromFile(FileName);
      MyText := MyFile.Text;

      if StringChangeEx(MyText, SearchString, ReplaceString, True) > 0 then //Only save if text has been changed.
      begin;
        MyFile.Text := MyText;
        MyFile.SaveToFile(FileName);
      end;
    except
      result := false;
    end;
  finally
    MyFile.Free;
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  fileName : string;
  lang : string;
begin
  if  CurStep=ssPostInstall then
    begin
      lang := ActiveLanguage();
      if lang = 'russian' then begin
        lang := 'ru';
      end
      else begin
          if lang = 'german' then begin
            lang := 'de';
          end
          else begin
            lang := '';
          end;
      end;
      if lang <> '' then begin
          fileName := ExpandConstant('{app}\settings-dist.json');
          //FileReplaceString(fileName, '"language": "en"', '"language": "' + lang + '"');
      end;
    end;
end;

function RedisNeedsInstall():boolean;
var
  ResultCode: integer;
begin
   result := not FileExists(ExpandConstant('{pf}\Redis\redis-service.exe'));
end;
function CouchNeedsInstall():boolean;
begin
   result := not FileExists(ExpandConstant('{pf32}\Apache Software Foundation\CouchDB\Install.exe'));
end;
function NodeJsNeedsInstall():boolean;
var
  ResultCode: integer;
begin
  //result := not DirExists(ExpandConstant('{userappdata}\npm'));
  result := not FileExists(ExpandConstant('{pf64}\nodejs\node.exe'));

  if result then begin
    result := not FileExists(ExpandConstant('{pf32}\nodejs\node.exe'));
  end;

  if result then begin
    result := not FileExists(ExpandConstant('{pf}\nodejs\node.exe'));
  end;

  if not DirExists(ExpandConstant('{userappdata}\npm')) then begin
     Exec(ExpandConstant('mkdir'), ExpandConstant('{userappdata}\npm'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
  if not DirExists(ExpandConstant('{userappdata}\npm-cache')) then begin
     Exec(ExpandConstant('mkdir'), ExpandConstant('{userappdata}\npm-cache'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
end;

function NodeJsPath(Param: String):String;
begin
  result := '';

  if DirExists(ExpandConstant('{pf}\nodejs')) then begin
    result := ExpandConstant('{pf}\nodejs');
  end;

  if DirExists(ExpandConstant('{pf32}\nodejs')) then begin
    result := ExpandConstant('{pf32}\nodejs');
  end;

  if DirExists(ExpandConstant('{pf64}\nodejs')) then begin
    result := ExpandConstant('{pf64}\nodejs');
  end;

end;

[Run]
; postinstall launch
Filename: "msiexec.exe"; Parameters: "/i ""{app}\node.msi"" /passive"; Check: NodeJsNeedsInstall
Filename: "{code:NodeJsPath}\npm.cmd"; Parameters: "install iobroker --prefix ""{app}""";
;Filename: "{app}\redisSetup.exe"; Check: RedisNeedsInstall
;Filename: "{app}\couchDBsetup.exe"; Parameters: "/SILENT"; Check: CouchNeedsInstall
;Filename: "{sys}\net.exe"; Parameters: "start redis"
;Filename: "{app}\install.bat"
;Filename: "{code:NodeJsPath}\node.exe"; Parameters: """{app}\install.js"""; Flags: runhidden;
;Filename: "{app}\serviceIoBroker.bat"; Parameters: "start"; Flags: runhidden;
; Add Firewall Rules
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node In"" program=""{code:NodeJsPath}\node.exe"" dir=in action=allow enable=yes"; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node Out"" program=""{code:NodeJsPath}\node.exe"" dir=out action=allow enable=yes"; Flags: runhidden;
Filename: http://localhost:8081/; Description: "Control page"; Flags: postinstall shellexec

[UninstallRun]
; Removes System Service
Filename: "{code:NodeJsPath}\node.exe"; Parameters: """{app}\uninstall.js"""; Flags: runhidden;
Filename: "{sys}\del"; Parameters: "/Q /S ""{app}\daemon""";
Filename: "{sys}\rmdir"; Parameters: "/Q /S ""{app}\daemon""";
Filename: "{sys}\del"; Parameters: "/Q /S ""{app}\node_modules""";
Filename: "{sys}\rmdir"; Parameters: "/Q /S ""{app}\node_modules""";
;Filename: "{sys}\net"; Parameters: "stop redis"; Flags: runhidden;
;Filename: "{pf}\Redis\unins000.exe"
;Filename: "{pf32}\Apache Software Foundation\CouchDB\unins000.exe"
; Remove Firewall Rules
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=""Node In"" program=""{code:NodeJsPath}\node.exe"""; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=""Node Out"" program=""{code:NodeJsPath}\node.exe"""; Flags: runhidden;
; Remove all leftovers

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "ioBroker automation platform"
#define MyAppShortName "ioBroker"
#define MyAppLCShortName "iobroker"
#define MyAppVersion "@@version"
#define MyAppPublisher "ioBroker.net"
#define MyAppURL "http://ioBroker.net/"
#define MyAppIcon "ioBroker.ico"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{97DA02F5-2E8C-4B96-BB42-61ED2BBF34DF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={drive:{pf}}\ioBroker
;DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=..\..\delivery
OutputBaseFilename={#MyAppShortName}Installer.{#MyAppVersion}
SetupIconFile={#MyAppIcon}
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=yes
ArchitecturesInstallIn64BitMode=x64
UninstallDisplayIcon={app}\{#MyAppIcon}
CloseApplications=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german";  MessagesFile: "compiler:Languages\German.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

; enable scripting to force admin mode
[Registry]
Root: HKLM; Subkey: "Software\Microsoft\Windows Script Host\Settings"; ValueType: dword; ValueName: "Enabled"; ValueData: "00000001"

[Files]
Source: "nodejs\node.msi"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
Source: "nodejs\node-x64.msi"; DestDir: "{app}"; DestName: "node.msi"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
;Source: "redis-v2.4.6\redis-2.4.6-setup-32-bit.exe"; DestDir: "{app}"; DestName: "redisSetup.exe"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
;Source: "redis-v2.4.6\redis-2.4.6-setup-64-bit.exe"; DestDir: "{app}"; DestName: "redisSetup.exe"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
;Source: "couchDB\couchDBsetup.exe"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall;
;Source: "*.js"; DestDir: "{app}"; Flags: ignoreversion
;Source: "install.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "package.json"; DestDir: "{app}"; Flags: ignoreversion
;Source: "npm.cmd"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppIcon}"; DestDir: "{app}"; Flags: ignoreversion
;Source: "..\.windows-ready\data\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "node_modules\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppShortName} Settings"; Filename: "http://localhost:8081"; IconFilename: "{app}\{#MyAppIcon}"
Name: "{group}\{#MyAppShortName} Uninstall"; Filename: "{uninstallexe}"
Name: "{group}\Start {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "start"
Name: "{group}\Stop {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "stop"
Name: "{group}\Restart {#MyAppShortName} Service"; Filename: "{app}\serviceIoBroker.bat"; Parameters: "restart"

[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  ResultCode: integer;
begin
  Result := '';
  if FileExists(ExpandConstant('{app}\serviceIoBroker.bat')) then begin
     Exec(ExpandConstant('{app}\serviceIoBroker.bat'), 'stop', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
end;

function FileReplaceString(const FileName, SearchString, ReplaceString: string):boolean;
var
  MyFile : TStrings;
  MyText : string;
begin
  MyFile := TStringList.Create;

  try
    result := true;

    try
      MyFile.LoadFromFile(FileName);
      MyText := MyFile.Text;

      if StringChangeEx(MyText, SearchString, ReplaceString, True) > 0 then //Only save if text has been changed.
      begin;
        MyFile.Text := MyText;
        MyFile.SaveToFile(FileName);
      end;
    except
      result := false;
    end;
  finally
    MyFile.Free;
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  fileName : string;
  lang : string;
begin
  if  CurStep=ssPostInstall then
    begin
      lang := ActiveLanguage();
      if lang = 'russian' then begin
        lang := 'ru';
      end
      else begin
          if lang = 'german' then begin
            lang := 'de';
          end
          else begin
            lang := '';
          end;
      end;
      if lang <> '' then begin
          fileName := ExpandConstant('{app}\settings-dist.json');
          //FileReplaceString(fileName, '"language": "en"', '"language": "' + lang + '"');
      end;
    end;
end;

function RedisNeedsInstall():boolean;
var
  ResultCode: integer;
begin
   result := not FileExists(ExpandConstant('{pf}\Redis\redis-service.exe'));
end;
function CouchNeedsInstall():boolean;
begin
   result := not FileExists(ExpandConstant('{pf32}\Apache Software Foundation\CouchDB\Install.exe'));
end;
function NodeJsNeedsInstall():boolean;
var
  ResultCode: integer;
begin
  //result := not DirExists(ExpandConstant('{userappdata}\npm'));
  result := not FileExists(ExpandConstant('{pf64}\nodejs\node.exe'));
  if not result then begin
    result := not FileExists(ExpandConstant('{pf32}\nodejs\node.exe'));
  end;

  if not DirExists(ExpandConstant('{userappdata}\npm')) then begin
     Exec(ExpandConstant('mkdir'), ExpandConstant('{userappdata}\npm'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
  if not DirExists(ExpandConstant('{userappdata}\npm-cache')) then begin
     Exec(ExpandConstant('mkdir'), ExpandConstant('{userappdata}\npm-cache'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end;
end;

function NodeJsPath(Param: String):String;
begin
  result := '';
  //result := not DirExists(ExpandConstant('{userappdata}\npm'));
  if DirExists(ExpandConstant('{pf64}\nodejs')) then begin
    result := ExpandConstant('{pf64}\nodejs');
  end;
  if DirExists(ExpandConstant('{pf32}\nodejs')) then begin
    result := ExpandConstant('{pf32}\nodejs');
  end;
end;

[Run]
; postinstall launch
Filename: "msiexec.exe"; Parameters: "/i ""{app}\node.msi"" /passive"; Check: NodeJsNeedsInstall
Filename: "{code:NodeJsPath}\npm.cmd"; Parameters: "install iobroker --prefix ""{app}""";
;Filename: "{app}\redisSetup.exe"; Check: RedisNeedsInstall
;Filename: "{app}\couchDBsetup.exe"; Parameters: "/SILENT"; Check: CouchNeedsInstall
;Filename: "{sys}\net.exe"; Parameters: "start redis"
;Filename: "{app}\install.bat"
;Filename: "{code:NodeJsPath}\node.exe"; Parameters: """{app}\install.js"""; Flags: runhidden;
;Filename: "{app}\serviceIoBroker.bat"; Parameters: "start"; Flags: runhidden;
; Add Firewall Rules
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node In"" program=""{code:NodeJsPath}\node.exe"" dir=in action=allow enable=yes"; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall add rule name=""Node Out"" program=""{code:NodeJsPath}\node.exe"" dir=out action=allow enable=yes"; Flags: runhidden;
Filename: http://localhost:8081/; Description: "Control page"; Flags: postinstall shellexec

[UninstallRun]
; Removes System Service
Filename: "{code:NodeJsPath}\node.exe"; Parameters: """{app}\uninstall.js"""; Flags: runhidden;
Filename: "{sys}\del"; Parameters: "/Q /S ""{app}\daemon""";
Filename: "{sys}\rmdir"; Parameters: "/Q /S ""{app}\daemon""";
Filename: "{sys}\del"; Parameters: "/Q /S ""{app}\node_modules""";
Filename: "{sys}\rmdir"; Parameters: "/Q /S ""{app}\node_modules""";
;Filename: "{sys}\net"; Parameters: "stop redis"; Flags: runhidden;
;Filename: "{pf}\Redis\unins000.exe"
;Filename: "{pf32}\Apache Software Foundation\CouchDB\unins000.exe"
; Remove Firewall Rules
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=""Node In"" program=""{code:NodeJsPath}\node.exe"""; Flags: runhidden;
Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=""Node Out"" program=""{code:NodeJsPath}\node.exe"""; Flags: runhidden;
; Remove all leftovers


remove _build folder, place installer executable inside project folder

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo------------------------------------------------------+
; |                                                                      |
; |  Unknown-Horizons - Inno Setup Script File                           |
; |  -------------------------------------------------------             |
; |                                                                      |
; |  Author:   Jens A. Koch <jakoch@web.de>                              |
; |  Author:   Thomas Kowaliczek-Schmer <thomas.kowaliczek@posteo.de>    |
; |  License:  MIT                                                       |
; |                                                                      |
; |  For the full copyright and license information, please view         |
; |  the LICENSE file that was distributed with this source code.        |
; |                                                                      |
; |  Note for developers                                                 |
; |  -------------------                                                 |
; |  A good resource for developing and understanding                    |
; |  Inno Setup Script files is the official "Inno Setup Help".          |
; |  Website:  http://jrsoftware.org/ishelp/index.php                    |
; |                                                                      |
; +---------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "2019.1"
#endif

#define APP_NAME             "Unknown-Horizons"
#define APP_COMPILER         "VC15"
#define APP_PUBLISHER        "Unknown-Horizons Team"
#define APP_URL              "http://www.unknown-horizons.org/"
#define APP_SUPPORT_URL      "https://github.com/unknown-horizons/unknown-horizons/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
AppId={{797B9070-BD1B-4DD9-8434-3A02697F9984}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}
UninstallDisplayIcon={app}\unknown-horizons\content\gfx\uh.ico
UninstallDisplayName={#APP_NAME}

; default installation folder is "C:\Unknown-Horizons". users might change this via dialog.
DefaultDirName=C:\Unknown-Horizons
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\uh.ico

; this creates the installer executable in the build folder
; for example: "_build\Unknown-Horizons-2019.1-Setup-VC15-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Logging
SetupLogging=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german";  MessagesFile: "compiler:Languages\German.isl"

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full";          Description: "Full installation (game and engine)"
Name: "custom";        Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: "unknown_horizons"; Description: "[unknown-horizons] Unknown-Horizons";              Types: full
Name: vcredist2015;       Description: "[dep libs] VCRedist2015";                          Types: full

[Files]
Source: "..\repackage\unknown-horizons\*";      DestDir: "{app}\unknown-horizons";      Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\Python36\*";              DestDir: "{app}\python";                Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\vc_redist.x86.exe";       DestDir: "{tmp}";                       Flags: deleteafterinstall;           Components: unknown_horizons

[Tasks]
Name: add_startmenu;       Description: Create Startmenu entries;                         Components: unknown_horizons
Name: add_quicklaunchicon; Description: Create a &Quick Launch icon for Unknown Horizons; GroupDescription: Additional Icons:; Components: unknown_horizons
Name: add_desktopicon;     Description: Create a &Desktop icon for Unknown Horizons;      GroupDescription: Additional Icons:; Components: unknown_horizons

[Icons]
; define a group for the startmenu
Name: {group}\Start Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Start Unknown-Horizons Debug; Filename: {app}\unknown-horizons\run_uh.bat; Parameters: "--debug"; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Uninstall Unknown-Horizons; Filename: "{uninstallexe}"; Tasks: add_startmenu
; desktop icon
Name: {userdesktop}\Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_desktopicon
; quick launch icon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Unknown Horizons; Filename: {app}\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_quicklaunchicon

; Define items to run automatically on installation...
[Run]
; add the Parameters, WorkingDir and StatusMsg as you wish, just keep here
; the conditional installation Check
Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/q /norestart"; Check: VCRedistNeedsInstall; StatusMsg: "Installing VC++ redistributables..."

[UninstallDelete]
;Type: filesandordirs; Name: "{userdocs}\My Games\unknown-horizons"
Type: filesandordirs; Name: "{app}\python"
Type: filesandordirs; Name: "{app}\unknown-horizons"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
; add path to fife (because libpng16-16.dll and other dependencies needs to be found)
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalMachine(ExpandConstant('{app}\python\Lib\site-packages\fife')); Components: unknown_horizons

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalMachine();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalMachine(ExpandConstant('{app}') + '\python\Lib\site-packages\fife');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF
type
  INSTALLSTATE = Longint;
const
  INSTALLSTATE_INVALIDARG = -2;  { An invalid parameter was passed to the function. }
  INSTALLSTATE_UNKNOWN = -1;     { The product is neither advertised or installed. }
  INSTALLSTATE_ADVERTISED = 1;   { The product is advertised but not installed. }
  INSTALLSTATE_ABSENT = 2;       { The product is installed for a different user. }
  INSTALLSTATE_DEFAULT = 5;      { The product is installed for the current user. }

  // Visual C++ 2015 Redistributable 14.0.24215.1
  VC_2015_REDIST_X86 = '{e2803110-78b3-4664-a479-3611a381656a}';
//  VC_2015_REDIST_X64 = '{d992c12e-cab2-426f-bde3-fb8c53950b0d}';

function MsiQueryProductState(szProduct: string): INSTALLSTATE;
  external 'MsiQueryProductState{#AW}@msi.dll stdcall';

function VCVersionInstalled(const ProductID: string): Boolean;
begin
  Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
end;

function VCRedistNeedsInstall: Boolean;
begin
  Result := not (VCVersionInstalled(VC_2015_REDIST_X86));
end;

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo------------------------------------------------------+
; |                                                                      |
; |  Unknown-Horizons - Inno Setup Script File                           |
; |  -------------------------------------------------------             |
; |                                                                      |
; |  Author:   Jens A. Koch <jakoch@web.de>                              |
; |  Author:   Thomas Kowaliczek-Schmer <thomas.kowaliczek@posteo.de>    |
; |  License:  MIT                                                       |
; |                                                                      |
; |  For the full copyright and license information, please view         |
; |  the LICENSE file that was distributed with this source code.        |
; |                                                                      |
; |  Note for developers                                                 |
; |  -------------------                                                 |
; |  A good resource for developing and understanding                    |
; |  Inno Setup Script files is the official "Inno Setup Help".          |
; |  Website:  http://jrsoftware.org/ishelp/index.php                    |
; |                                                                      |
; +---------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "2019.1"
#endif

#define APP_NAME             "Unknown-Horizons"
#define APP_COMPILER         "VC15"
#define APP_PUBLISHER        "Unknown-Horizons Team"
#define APP_URL              "http://www.unknown-horizons.org/"
#define APP_SUPPORT_URL      "https://github.com/unknown-horizons/unknown-horizons/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
AppId={{797B9070-BD1B-4DD9-8434-3A02697F9984}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}
UninstallDisplayIcon={app}\unknown-horizons\content\gfx\uh.ico
UninstallDisplayName={#APP_NAME}

; default installation folder is "C:\Unknown-Horizons". users might change this via dialog.
DefaultDirName=C:\Unknown-Horizons
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\uh.ico

; this creates the installer executable in the build folder
; for example: "_build\Unknown-Horizons-2019.1-Setup-VC15-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..\_build

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Logging
SetupLogging=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german";  MessagesFile: "compiler:Languages\German.isl"

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full";          Description: "Full installation (game and engine)"
Name: "custom";        Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: "unknown_horizons"; Description: "[unknown-horizons] Unknown-Horizons";              Types: full
Name: vcredist2015;       Description: "[dep libs] VCRedist2015";                          Types: full

[Files]
Source: "..\repackage\unknown-horizons\*";      DestDir: "{app}\unknown-horizons";      Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\Python36\*";              DestDir: "{app}\python";                Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\vc_redist.x86.exe";       DestDir: "{tmp}";                       Flags: deleteafterinstall;           Components: unknown_horizons

[Tasks]
Name: add_startmenu;       Description: Create Startmenu entries;                         Components: unknown_horizons
Name: add_quicklaunchicon; Description: Create a &Quick Launch icon for Unknown Horizons; GroupDescription: Additional Icons:; Components: unknown_horizons
Name: add_desktopicon;     Description: Create a &Desktop icon for Unknown Horizons;      GroupDescription: Additional Icons:; Components: unknown_horizons

[Icons]
; define a group for the startmenu
Name: {group}\Start Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Start Unknown-Horizons Debug; Filename: {app}\unknown-horizons\run_uh.bat; Parameters: "--debug"; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Uninstall Unknown-Horizons; Filename: "{uninstallexe}"; Tasks: add_startmenu
; desktop icon
Name: {userdesktop}\Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_desktopicon
; quick launch icon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Unknown Horizons; Filename: {app}\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_quicklaunchicon

; Define items to run automatically on installation...
[Run]
; add the Parameters, WorkingDir and StatusMsg as you wish, just keep here
; the conditional installation Check
Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/q /norestart"; Check: VCRedistNeedsInstall; StatusMsg: "Installing VC++ redistributables..."

[UninstallDelete]
;Type: filesandordirs; Name: "{userdocs}\My Games\unknown-horizons"
Type: filesandordirs; Name: "{app}\python"
Type: filesandordirs; Name: "{app}\unknown-horizons"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
; add path to fife (because libpng16-16.dll and other dependencies needs to be found)
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalMachine(ExpandConstant('{app}\python\Lib\site-packages\fife')); Components: unknown_horizons

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalMachine();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalMachine(ExpandConstant('{app}') + '\python\Lib\site-packages\fife');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF
type
  INSTALLSTATE = Longint;
const
  INSTALLSTATE_INVALIDARG = -2;  { An invalid parameter was passed to the function. }
  INSTALLSTATE_UNKNOWN = -1;     { The product is neither advertised or installed. }
  INSTALLSTATE_ADVERTISED = 1;   { The product is advertised but not installed. }
  INSTALLSTATE_ABSENT = 2;       { The product is installed for a different user. }
  INSTALLSTATE_DEFAULT = 5;      { The product is installed for the current user. }

  // Visual C++ 2015 Redistributable 14.0.24215.1
  VC_2015_REDIST_X86 = '{e2803110-78b3-4664-a479-3611a381656a}';
//  VC_2015_REDIST_X64 = '{d992c12e-cab2-426f-bde3-fb8c53950b0d}';

function MsiQueryProductState(szProduct: string): INSTALLSTATE;
  external 'MsiQueryProductState{#AW}@msi.dll stdcall';

function VCVersionInstalled(const ProductID: string): Boolean;
begin
  Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
end;

function VCRedistNeedsInstall: Boolean;
begin
  Result := not (VCVersionInstalled(VC_2015_REDIST_X86));
end;


Comment out App Id because the same as for fife sdk. Fix final uninstall entry in startmenu. Small clean ups.

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo------------------------------------------------------+
; |                                                                      |
; |  Unknown-Horizons - Inno Setup Script File                           |
; |  -------------------------------------------------------             |
; |                                                                      |
; |  Author:   Jens A. Koch <jakoch@web.de>                              |
; |  Author:   Thomas Kowaliczek-Schmer <thomas.kowaliczek@posteo.de>    |
; |  License:  MIT                                                       |
; |                                                                      |
; |  For the full copyright and license information, please view         |
; |  the LICENSE file that was distributed with this source code.        |
; |                                                                      |
; |  Note for developers                                                 |
; |  -------------------                                                 |
; |  A good resource for developing and understanding                    |
; |  Inno Setup Script files is the official "Inno Setup Help".          |
; |  Website:  http://jrsoftware.org/ishelp/index.php                    |
; |                                                                      |
; +---------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "2017.1"
#endif

#define APP_NAME             "Unknown-Horizons"
#define APP_COMPILER         "VC14"
#define APP_PUBLISHER        "Unknown-Horizons Team"
#define APP_URL              "http://www.unknown-horizons.org/"
#define APP_SUPPORT_URL      "https://github.com/unknown-horizons/unknown-horizons/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
;AppId={{8A27DF0C-689B-4B76-8BFC-AFCDD90C1A31}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}
UninstallDisplayIcon={app}\unknown-horizons\content\gfx\uh.ico
UninstallDisplayName={#APP_NAME}

; default installation folder is "C:\Unknown-Horizons". users might change this via dialog.
DefaultDirName=C:\Unknown-Horizons
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\uh.ico

; this creates the installer executable in the build folder
; for example: "_build\Unknown-Horizons-2017.1-Setup-VC14-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..\_build

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Tell Windows to reload the environment, because Registry change (file association change: .py)
ChangesAssociations=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full";          Description: "Full installation (game, engine)"
Name: "custom";        Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: "unknown_horizons"; Description: "[unknown-horizons] Unknown-Horizons";              Types: full;
Name: fifengine;          Description: "[fifengine] Fifengine - Isometric Game Engine";    Types: full;
Name: "Python";           Description: "[build tools] Python - programming language";
Name: "Python\py27";      Description: "[build tools] Python v2.7";                        Types: full; Flags: exclusive

[Files]
Source: "..\repackage\unknown-horizons\*";      DestDir: "{app}\unknown-horizons";      Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\Python27\*";              DestDir: "{app}\python";                Flags: recursesubdirs ignoreversion; Components: "Python\py27"
; Fifengine below Python, because we are installing the python library into the Python installation folder
Source: "..\repackage\libfife.win32-py2.7.msi"; DestDir: "{app}\libfife";               Flags: recursesubdirs;               Components: fifengine

[Tasks]
Name: add_startmenu;       Description: Create Startmenu entries
Name: add_quicklaunchicon; Description: Create a &Quick Launch icon for Unknown Horizons; GroupDescription: Additional Icons:; Components: unknown_horizons
Name: add_desktopicon;     Description: Create a &Desktop icon for Unknown Horizons;      GroupDescription: Additional Icons:; Components: unknown_horizons

[Icons]
; define a group for the startmenu
Name: {group}\Start Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Uninstall Unknown-Horizons; Filename: "{uninstallexe}"; Tasks: add_startmenu
; desktop icon
Name: {userdesktop}\Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_desktopicon
; quick launch icon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Unknown Horizons; Filename: {app}\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_quicklaunchicon

; Define items to run automatically on installation...
[Run]
; install "libfife for python2.7" only when "python27" and "fifengine" are selected
; install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py2.7.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python2.7"; Components: Python\py27 and fifengine

; Define items to run automatically on un-installation...
[UninstallRun]
; un-install "libfife"
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py2.7.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python2.7"; Flags: runascurrentuser runhidden

[UninstallDelete]
;Type: filesandordirs; Name: "{userdocs}\My Games\unknown-horizons"
Type: filesandordirs; Name: "{app}\python"
Type: filesandordirs; Name: "{app}\unknown-horizons"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
;
; add path to Python
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python')); Components: Python\py27;
;
; add path to libfife
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python\Lib\site-packages\fife')); Components: fifengine;
;
; Create File Association
Root: HKCR; Subkey: ".py";                            ValueType: string; ValueName: ""; ValueData: "Python.File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Python.File";                    ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Python.File\DefaultIcon";        ValueType: string; ValueName: ""; ValueData: "{app}\python\DLLs\py.ico"
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python\python.exe"" ""%1"" %*"

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalUser();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalUser(ExpandConstant('{app}') + '\python\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo------------------------------------------------------+
; |                                                                      |
; |  Unknown-Horizons - Inno Setup Script File                           |
; |  -------------------------------------------------------             |
; |                                                                      |
; |  Author:   Jens A. Koch <jakoch@web.de>                              |
; |  Author:   Thomas Kowaliczek-Schmer <thomas.kowaliczek@posteo.de>    |
; |  License:  MIT                                                       |
; |                                                                      |
; |  For the full copyright and license information, please view         |
; |  the LICENSE file that was distributed with this source code.        |
; |                                                                      |
; |  Note for developers                                                 |
; |  -------------------                                                 |
; |  A good resource for developing and understanding                    |
; |  Inno Setup Script files is the official "Inno Setup Help".          |
; |  Website:  http://jrsoftware.org/ishelp/index.php                    |
; |                                                                      |
; +---------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "2017.1"
#endif

#define APP_NAME             "Unknown-Horizons"
#define APP_COMPILER         "VC14"
#define APP_PUBLISHER        "Unknown-Horizons Team"
#define APP_URL              "http://www.unknown-horizons.org/"
#define APP_SUPPORT_URL      "https://github.com/unknown-horizons/unknown-horizons/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
AppId={{8A27DF0C-689B-4B76-8BFC-AFCDD90C1A31}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}

; default installation folder is "c:\Unknown-Horizons". users might change this via dialog.
DefaultDirName=c:\Unknown-Horizons
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\uh.ico

; this creates the installer executable in the build folder
; for example: "_build\Unknown-Horizons-2017.1-Setup-VC14-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..\_build

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Tell Windows to reload the environment, because Registry change (file association change: .py)
ChangesAssociations=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full";          Description: "Full installation (game, engine)"
Name: "custom";        Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: "unknown_horizons"; Description: "[unknown-horizons] Unknown-Horizons";              Types: full;
Name: fifengine;          Description: "[fifengine] Fifengine - Isometric Game Engine";    Types: full;
Name: "Python";           Description: "[build tools] Python - programming language";
Name: "Python\py27";      Description: "[build tools] Python v2.7";                        Types: full; Flags: exclusive

[Files]
Source: "..\repackage\unknown-horizons\*";      DestDir: "{app}\unknown-horizons";      Flags: recursesubdirs ignoreversion; Components: unknown_horizons
Source: "..\repackage\Python27\*";              DestDir: "{app}\python";                Flags: recursesubdirs ignoreversion; Components: "Python\py27"
; Fifengine below Python, because we are installing the python library into the Python installation folder
Source: "..\repackage\libfife.win32-py2.7.msi"; DestDir: "{app}\libfife";               Flags: recursesubdirs;               Components: fifengine

[Tasks]
Name: add_startmenu;       Description: Create Startmenu entries
Name: add_quicklaunchicon; Description: Create a &Quick Launch icon for Unknown Horizons; GroupDescription: Additional Icons:; Components: unknown_horizons
Name: add_desktopicon;     Description: Create a &Desktop icon for Unknown Horizons;      GroupDescription: Additional Icons:; Components: unknown_horizons

[Icons]
; define a group for the startmenu
Name: {group}\Start Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
Name: {group}\Uninstall; Filename: "{uninstallexe}"; Flags: preventpinning excludefromshowinnewinstall; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_startmenu
; desktop icon
Name: {userdesktop}\Unknown-Horizons; Filename: {app}\unknown-horizons\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_desktopicon
; quick launch icon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Unknown Horizons; Filename: {app}\run_uh.bat; IconFilename: "{app}\unknown-horizons\content\gfx\uh.ico"; Tasks: add_quicklaunchicon

; Define items to run automatically on installation...
[Run]
; install "libfife for python2.7" only when "python27" and "fifengine" are selected
; install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py2.7.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python2.7"; Components: Python\py27 and fifengine

; Define items to run automatically on un-installation...
[UninstallRun]
; un-install "libfife"
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py2.7.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python2.7"; Flags: runascurrentuser runhidden

[UninstallDelete]
;Type: filesandordirs; Name: "{userdocs}\My Games\unknown-horizons"
Type: filesandordirs; Name: "{app}\python"
Type: filesandordirs; Name: "{app}\unknown-horizons"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
;
; add path to Python
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python')); Components: Python\py27;
;
; add path to libfife
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python\Lib\site-packages\fife')); Components: fifengine;
;
; Create File Association
Root: HKCR; Subkey: ".py";                            ValueType: string; ValueName: ""; ValueData: "Python.File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Python.File";                    ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Python.File\DefaultIcon";        ValueType: string; ValueName: ""; ValueData: "{app}\python\DLLs\py.ico"
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python\python.exe"" ""%1"" %*"

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalUser();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalUser(ExpandConstant('{app}') + '\python\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;