WriteRegExpandStr HKCR
"*\shell
${MAIN_EXE_NAME}
"
""
"使用
${MAIN_EXE_NAME}
打开"
WriteRegExpandStr HKCR
"*\shell
${MAIN_EXE_NAME}
"
"Icon"
"
$INSTDIR
${MAIN_EXE_NAME}
.exe"
WriteRegExpandStr HKCR
"*\shell
${MAIN_EXE_NAME}
\command"
""
`
"
$INSTDIR
${MAIN_EXE_NAME}
.exe"
"%V"
`
2.2 卸载时删除注册表
DeleteRegKey HKLM
"
${PRODUCT_DIR_REGKEY}
"
DeleteRegKey HKCR
"*\shell
${MAIN_EXE_NAME}
"
DeleteRegKey HKCR
"*\shell
${MAIN_EXE_NAME}
\command"
nsis检测是否已安装此应用
#此处检测当前是否安装此应用
Call HandleAppInstall
StrCpy
4
6 -10
IfFileExists
4
\uninst
.
e
x
e
f
o
u
n
d
St
r
Cp
y
6 ""
DeleteRegValue
PRO
D
U
C
T
U
N
I
NS
T
R
OO
T
K
E
Y
"
{PATH_KEY}" "
PRO
D
U
C
T
P
A
T
H
N
A
ME
"
f
o
u
n
d
:
{if} "
I
NST
D
I
R
{EXE_NAME}" != "
6"
{If} "
6"
!
=
""
St
r
Cp
y
BUTTON_NAME "卸载"
StrCpy
R
8"
其他文件下已安装了
{PRODUCT_NAME},是否卸载"
StrCpy
R
7"2"
C
a
llS
h
o
wM
s
g
B
o
x
p
o
p
0
I
f
0 == 0
goto InstallAbort
E
n
d
I
f
{If}
0
==
1
St
r
Cp
y
4
6
−
10
E
x
ec
Wai
t
′
"
4\uninst.exe"'
0
De
t
ai
lP
r
in
t
"
u
nin
s
t
.
e
x
ere
t
u
r
n
e
d
0"
Delete "
6"
RM
D
i
r
4
goto InstallAbort
${EndIf}
${EndIf}
${EndIf}
IfFileExists 用来判断文件路径下卸载程序是否还存在,如果存在就继续执行,不存在跳过