路径中的GUID无关紧要。如果无法读取该值,则可能是64位问题,您可能需要
SetRegView
.
Process Monitor
可能会有所帮助,但在挖掘调试工具之前,你应该先做
MessageBox mb_ok $R0
之后
ReadRegStr
看看它是否读到了什么。
你不能只是打电话
IfFileExists
UninstallString
您可以使用这样的方法来获取路径:
!macro GetAppPathFromCommandLine output input
Push '${input}'
Call GetAppPathFromCommandLine
Pop ${output}
!macroend
Function GetAppPathFromCommandLine
Exch $0 ; input
Push $1 ; find
Push $2 ; start offset
Push $3 ; temp
Push $4 ; pos
StrCpy $1 ' '
StrCpy $2 ""
StrCpy $3 $0 1
StrCpy $4 -1
StrCmp $3 '"' 0 +4
StrCpy $1 $3
StrCpy $2 1
StrCpy $4 ""
loop:
IntOp $4 $4 + 1
StrCpy $3 $0 1 $4
StrCmp $3 "" done
StrCmp $3 $1 done loop
done:
IntOp $4 $4 - $2
StrCpy $0 $0 $4 $2
Pop $4
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd
Section
!insertmacro GetAppPathFromCommandLine $0 'c:\foo\bar.exe'
DetailPrint |$0|
!insertmacro GetAppPathFromCommandLine $0 '"c:\foo bar\baz.exe"'
DetailPrint |$0|
!insertmacro GetAppPathFromCommandLine $0 'c:\foo\bar.exe param1 "pa ra m2" param3'
DetailPrint |$0|
!insertmacro GetAppPathFromCommandLine $0 '"c:\foo bar\baz.exe" param1 "pa ra m2" param3'
DetailPrint |$0|
SectionEnd