diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index e0c583bc..34ba1f16 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -160,7 +160,13 @@ class CwtchFfi implements Cwtch { } } else if (Platform.isWindows) { cwtchDir = envVars['CWTCH_DIR'] ?? path.join(envVars['UserProfile']!, ".cwtch"); - bundledTor = "Tor\\Tor\\tor.exe"; + String currentTor = path.join(Directory.current.absolute.path, "Tor\\Tor\\tor.exe"); + if (await File(currentTor).exists()) { + bundledTor = currentTor; + } else { + String exeDir = path.dirname(Platform.resolvedExecutable); + bundledTor = path.join(exeDir, "Tor\\Tor\\tor.exe"); + } } else if (Platform.isMacOS) { cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, "Library/Application Support/Cwtch"); if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) { diff --git a/windows/nsis/cwtch-installer.nsi b/windows/nsis/cwtch-installer.nsi index a63ee737..7e1eca30 100644 --- a/windows/nsis/cwtch-installer.nsi +++ b/windows/nsis/cwtch-installer.nsi @@ -50,7 +50,10 @@ ShowInstDetails show !define MUI_WELCOMEPAGE_TITLE "Welcome to the Cwtch installer" !define MUI_WELCOMEPAGE_TEXT "Cwtch (pronounced: kutch) is a Welsh word roughly meaning 'a hug that creates a safe space'$\n$\n\ - Cwtch is a platform for building consentful, decentralized, untrusted infrastructure using metadata resistant group communication applications. Currently there is a selfnamed instant messaging prototype app that is driving development and testing. Many Further apps are planned as the platform matures." + Cwtch is a platform for building consentful, decentralized, untrusted infrastructure using metadata resistant group communication applications. Currently there is a selfnamed instant messaging prototype app that is driving development and testing. Many Further apps are planned as the platform matures.$\n$\n\ + Please close any running copies of Cwtch before installing a new version." + +; Detecting if Cwtch is running and reminding the user or closing it appears to require 3rd party plugins that take the form of decade+ old .dlls in zips from a wiki... !define MUI_FINISHPAGE_TITLE "Enjoy Cwtch" !define MUI_FINISHPAGE_RUN $INSTDIR/cwtch.exe @@ -96,10 +99,16 @@ Section WriteUninstaller "$INSTDIR\uninstall.exe" + # https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cwtch" \ + "DisplayName" "Cwtch" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cwtch" \ + "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" SectionEnd Section "Uninstall" RMDir /r /REBOOTOK "$INSTDIR" DeleteRegKey /ifempty HKCU "Software\Cwtch\installLocation" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" SectionEnd \ No newline at end of file