[Launch]
ProgramExecutable=Zotero32\zotero.exe
ProgramExecutable64=Zotero\zotero.exe
CommandLineArguments='-profile "%PAL:DataDir%\Mozilla\Profile" -datadir "%PAL:DataDir%\profile"'
WaitForEXE1=updater.exe
RefreshShellIcons=both
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
Registry=true

[RegistryKeys]
-=HKCU\Software\Classes\zoteroFile
-=HKCU\Software\Classes\zotero
-=HKCU\Software\Classes\.ris
-=HKCU\Software\Classes\.isi
-=HKCU\Software\Classes\.mods
-=HKCU\Software\Classes\.rdf
-=HKCU\Software\Classes\.bib
-=HKCU\Software\Classes\.bibtex
-=HKCU\Software\Classes\.marc
-=HKCU\Software\Classes\.csl
Zotero=HKCU\Software\Zotero

[RegistryValueWrite]
; Zotero file handler
HKCU\Software\Classes\.ris\=REG_SZ:zoteroFile
HKCU\Software\Classes\.isi\=REG_SZ:zoteroFile
HKCU\Software\Classes\.mods\=REG_SZ:zoteroFile
HKCU\Software\Classes\.rdf\=REG_SZ:zoteroFile
HKCU\Software\Classes\.bib\=REG_SZ:zoteroFile
HKCU\Software\Classes\.bibtex\=REG_SZ:zoteroFile
HKCU\Software\Classes\.marc\=REG_SZ:zoteroFile
HKCU\Software\Classes\.csl\=REG_SZ:zoteroFile
HKCU\Software\Classes\zoteroFile\shell\open\command\=REG_SZ:"%PAL:LauncherPath%" -file "%1"
HKCU\Software\Classes\zoteroFile\DefaultIcon\=REG_SZ:%PAL:LauncherPath%,0
; Zotero protocol handler
HKCU\Software\Classes\zotero\=REG_SZ:zoteroProtocol
HKCU\Software\Classes\zotero\URL Protocol=REG_SZ:
HKCU\Software\Classes\zotero\shell\open\command\=REG_SZ:"%PAL:LauncherPath%" -url "%1"

[DirectoriesMove]
-=%LocalAppData%\Zotero
-=%AppData%\Zotero
-=%HOMEPATH%\Zotero

[DirectoriesCleanupIfEmpty]
1=%LocalAppDataLow%\Mozilla
2=%AppData%\Mozilla\Extensions
3=%AppData%\Mozilla\SystemExtensionsDev
4=%AppData%\Mozilla
5=%PAL:DataDir%\Temp

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\prefs.js
Find=INIT_DATA_DIR
Replace=%PAL:DataDir:DoubleBackslash%\\profile

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\prefs.js
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\prefs.js
Find=%PAL:LastDrive%%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite4]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\prefs.js
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

[FileWrite5]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\extensions.json
Find=INIT_DATA_DIR
Replace=%PAL:DataDir:DoubleBackslash%\\profile

[FileWrite6]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\extensions.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\

[FileWrite7]
Type=Replace
File=%PAL:DataDir%\Mozilla\Profile\extensions.json
Find=%PAL:LastDrive%%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PortableAppsBaseDir:DoubleBackslash%\\