SHARE
TWEET

Untitled

a guest Jul 4th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !macro CustomCodePreInstall
  2.     ${If} ${FileExists} "$INSTDIR\Data\user\*.*"
  3.         Rename "$INSTDIR\Data\user" "$INSTDIR\Data\.rednotebook"
  4.         ${ConfigWrite} "$INSTDIR\Data\.rednotebook\configuration.cfg" "dataDir=" "$INSTDIR\Data\.rednotebook\data" $R0
  5.     ${EndIf}
  6.     ${If} ${FileExists} "$INSTDIR\Data\.rednotebook\*.*"
  7.     ${AndIfNot} ${FileExists} "$INSTDIR\Data\usersettings\*.*"
  8.         CreateDirectory "$INSTDIR\Data\usersettings"
  9.         Rename "$INSTDIR\Data\.rednotebook\templates" "$INSTDIR\Data\usersettings\templates"
  10.         Rename "$INSTDIR\Data\.rednotebook\tmp" "$INSTDIR\Data\usersettings\tmp"
  11.         Rename "$INSTDIR\Data\.rednotebook\configuration.cfg" "$INSTDIR\Data\usersettings\configuration.cfg"
  12.         Rename "$INSTDIR\Data\.rednotebook\rednotebook.log" "$INSTDIR\Data\usersettings\rednotebook.log"
  13.         CopyFiles /SILENT "$INSTDIR\Data\.rednotebook\data\*.*" "$INSTDIR\Data\usersettings\data"
  14.         RMDir /r "$INSTDIR\Data\.rednotebook"
  15.         ${ConfigWrite} "$INSTDIR\Data\usersettings\configuration.cfg" "dataDir=" "../../Data/usersettings/data" $R0
  16.     ${EndIf}
  17.     ${If} ${FileExists} "$INSTDIR\Data\.rednotebook\*.*"
  18.     ${AndIf} ${FileExists} "$INSTDIR\Data\usersettings\*.*"
  19.         CopyFiles /SILENT "$INSTDIR\Data\.rednotebook\data\*.*" "$INSTDIR\Data\usersettings\data"
  20.         RMDir /r "$INSTDIR\Data\.rednotebook"
  21.         ${ConfigWrite} "$INSTDIR\Data\usersettings\configuration.cfg" "dataDir=" "../../Data/usersettings/data" $R0
  22.     ${EndIf}
  23.     # Handle upgrades from versions without fonts
  24.     ${If} ${FileExists} "$INSTDIR\App\AppInfo\appinfo.ini"
  25.         ReadINIStr $R2 "$INSTDIR\App\AppInfo\appinfo.ini" "Version" "PackageVersion"
  26.         ${VersionCompare} "$R2" "1.3.0.4" $9 # 1.3.0.4 is proposed Rev 1 number
  27.         ${If} $9 == "2"
  28.             CreateDirectory "$INSTDIR\Data\font.conf"
  29.             CopyFiles /SILENT "$INSTDIR\App\DefaultData\fonts.conf" "$INSTDIR\Data\font.conf"
  30.         ${EndIf}
  31.     ${EndIf}   
  32. !macroend
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top