]> git.lyx.org Git - lyx.git/blobdiff - development/Win32/packaging/AltInstaller/Aspell.nsh
installer: transfer some info from AltInstaller
[lyx.git] / development / Win32 / packaging / AltInstaller / Aspell.nsh
index 802cca1aecee97a210f403d569ccb96c6887d28a..e9137ed038df55ddad2b219243c910b7d1a5e9d2 100644 (file)
@@ -11,6 +11,16 @@ Function InstallAspell
    File /r "${PRODUCT_SOURCEDIR}\${AspellInstall}"
    # copy the files and register Aspell
    CopyFiles "$INSTDIR\${AspellInstall}" "$APPDATA"
+   # finally copy the Aspell personal files to the Application folder of all users
+   # this assures that every user can have its own word list
+   StrCpy $AppSubfolder "Aspell"
+   StrCpy $AppFiles "$APPDATA\Aspell\Personal"
+   ${if} $ProductRootKey == "HKLM" # if install for all users
+    Call CreateAppPathSub # function from LyXUtils.nsh
+   ${else}
+    CreateDirectory "$APPDATA\$AppSubfolder"
+    CopyFiles "$AppFiles" "$APPDATA\$AppSubfolder"
+   ${endif}
    
    WriteRegStr HKLM "SOFTWARE\Aspell" "Base Path" "${AspellDir}"
    WriteRegStr HKLM "SOFTWARE\Aspell" "Dictionary Path" "${AspellDictPath}"
@@ -209,7 +219,7 @@ Function InstallAspellDictionary
  
  # show message about Aspell dictionaries
  # the code rule to display the correct message:
- # - when the englisch dictionary is already installed or couldn't be installed -> set a "1"
+ # - when the English dictionary is already installed or couldn't be installed -> set a "1"
  # - when the dictionary of the chosen LyX menu language is already installed or couldn't be installed -> set a "2"
  # - when the dictionary of the Windows system language is already installed or couldn't be installed -> set a "3"
  # - when the dictionary of the chosen LyX menu language is equal to the dictionary of the Windows system language -> set a "4"
@@ -245,7 +255,16 @@ Function InstallAspellDictionary
  DownloadNow:
   ExecShell "open" "${AspellLocationExact}"
  DownloadLater:
-        
+
+ # when something was installed, copy the Aspell dictionary files to the Application
+ # folder of all users this assures that every user can have its own word list
+ ${if} $AspellInstallYes != "321"
+ ${andif} $AspellInstallYes != "421" 
+  StrCpy $AppSubfolder "Aspell"
+  StrCpy $AppFiles "$APPDATA\Aspell\Dictionaries"
+  Call CreateAppPathSub # function from LyXUtils.nsh
+ ${endif}
 FunctionEnd
 
 !endif # endif ${INSTALLER_TYPE} == "NotUpdate"
@@ -258,6 +277,9 @@ Function un.UninstAspell
     ReadRegStr $1 SHCTX "Software\Aspell" "Base Path"
     # delete Aspells' install folder
     RMDir /r $1
+    # remove LyX's config files
+    StrCpy $AppSubfolder "Aspell"
+    Call un.DelAppPathSub # function from LyXUtils.nsh
     # unregister Aspell and its dictionaries
     DeleteRegKey SHCTX "Software\Aspell"
     DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell"