Update2: Wrote a new launch batch file for emacs. Working now.
Update: It didn't work. I mistook another version of SumatraPDF in system path as the one on my USB drive. Still looking for a solution.
I fixed the problem by using a completely different approach.
It seems that inverse search setting argument is always valid for files in current folder, i.e.,
SumatraPDF root. So I created a shortcut to where
emacsclientw.exe is then it worked.
By this observation. For inverse search, I only have to use
"emacsclientw.exe" -n +%l "%f
in SumatraPDF inverse settings. Note that
emacsclientw.exe refers to actually a shortcut
*.lnk file with the same name in
Next, I created a launch bat for emacs which at start up, it checks if there is a shortcut to
SumatraPDF root. If not, it will create one. Essentially, this approach bypasses the parsing problem of auto expansion. It is portable and it works well.
The emacs launcher I created is available on github.