部份就可以直接支援空格路徑了 ... 未經測試 ...
!define NAME "PortableFirefox"
!define VER "0.0.3"
!packhdr "C:\tmp.dat" "
'c:\Program Files\UPX\upx.exe
' --best --crp-ms=999999 C:\tmp.dat"
;=== Out program information
Name "${NAME}"
OutFile "${NAME}.exe"
Caption "${NAME} - Making Firefox Portable"
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True
;=== Set program icon
Icon "unofficial_firefox.ico"
Section "Main"
IfFileExists "$EXEDIR\profile\chrome\chrome.rdf" ChromeFound RunFirefox
ChromeFound:
FileOpen $0 "$EXEDIR\profile\chrome\chrome.rdf" r
FileOpen $R0 "$EXEDIR\profile\chrome\chrome.rdf.new" w
ClearErrors ; if there's an error, we're done with the file
NextLine:
FileWrite $R0 $4
FileRead $0 $4
IfErrors NoMoreLines
StrCpy $5 $4 39
;MessageBox MB_OK "$5"
StrCmp $5 ` c:baseURL="jar:file:` "" NextLine
StrCpy $R4 40
NotYet:
IntOp $R4 $R4 + 1
StrCpy $7 $4 10 $R4 ; looking for the point to strip the extension path
;MessageBox MB_OK "$7"
StrCmp $7 "extensions" PathFound NotYet
PathFound:
StrCpy $5 $4 "" $R4
;MessageBox MB_OK "The following extension has an absolute path.$\n$\n$5$\n$\nWe'll make it relative, because that's our purpose

"
StrCpy $4 ` c:baseURL="jar:resource:/profile/$5` ; the path made relative
GoTo NextLine
NoMoreLines:
FileClose $0
FileClose $R0
CopyFiles "$EXEDIR\profile\chrome\chrome.rdf" "$EXEDIR\profile\chrome\chrome.rdf.old" ; rename it just in case
CopyFiles "$EXEDIR\profile\chrome\chrome.rdf.new" "$EXEDIR\profile\chrome\chrome.rdf" ; that was our purpose
RunFirefox:
Exec
' "$EXEDIR\firefox.exe
" -profile
"$EXEDIR\profile\
" 'SectionEnd