Archive: un.onInit error


Function un.onInit

!ifndef RUNSAME ;;Èç¹ûûÓж¨ÒåRUNSAME±àÒë
;;½ûÖ¹¶à¸öжÔØʵÁ¦ÔËÐС£
SYSTEM::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +2
Quit
!endif

;;¼ì²éÊDz»ÊÇDisk_root.DIR»òÍøÂç¸ùĿ¼»òÊÇÓû§ÎĵµºÍÉèÖÃĿ¼
StrLen $0 "$INSTDIR"
${if} $0 <= 3
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "\
²Ù×÷¶ÔÏóÊÇÒ»¸öÇý¶¯Æ÷¸ùĿ¼£¬½ûֹжÔسÌÐòÖ´ÐС£ "
Quit
${endif}

StrCpy $1 "$INSTDIR" 2
StrCmp "$1" "\\" 0 +4
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "\
²Ù×÷¶ÔÏóÊÇÒ»¸öÍøÂçÖ÷»úĿ¼£¬½ûֹжÔسÌÐòÖ´ÐС£ "
Quit

StrCpy $1 "$INSTDIR" 22 -22
StrCmp "$1" "Documents and Settings" 0 +4
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "\
²Ù×÷¶ÔÏóÊÇϵͳÓû§ÉèÖÃÐÅÏ¢Êý¾Ý±£´æĿ¼£¬½ûֹжÔسÌÐòÖ´ÐС£ "
Quit

;;¼ì²éÊDz»ÊÇϵͳÖØҪĿ¼
StrCmp "$INSTDIR" "$PROGRAMFILES" error 0
StrCmp "$INSTDIR" "$ADMINTOOLS" error 0
StrCmp "$INSTDIR" "$HISTORY" error 0
StrCmp "$INSTDIR" "$COOKIES" error 0
StrCmp "$INSTDIR" "$INTERNET_CACHE" error 0
StrCmp "$INSTDIR" "$PRINTHOOD" error 0
StrCmp "$INSTDIR" "$PROFILE" error 0
StrCmp "$INSTDIR" "$APPDATA" error 0
StrCmp "$INSTDIR" "$NETHOOD" error 0
StrCmp "$INSTDIR" "$PICTURES" error 0
StrCmp "$INSTDIR" "$COMMONFILES" error 0
StrCmp "$INSTDIR" "$DESKTOP" error 0
StrCmp "$INSTDIR" "$PROGRAMFILES\Windows NT" error 0
StrCmp "$INSTDIR" "$PROGRAMFILES\CatTools" hsfunegg 0
StrCmp "$INSTDIR" "$WINDIR" error 0
StrCmp "$INSTDIR" "$SYSDIR" error 0
StrCmp "$INSTDIR" "$TEMP" error 0
StrCmp "$INSTDIR" "$STARTMENU" error 0
StrCmp "$INSTDIR" "$SMPROGRAMS" error 0
StrCmp "$INSTDIR" "$SMSTARTUP" error 0
StrCmp "$INSTDIR" "$QUICKLAUNCH" error 0
StrCmp "$INSTDIR" "$DOCUMENTS" error 0
StrCmp "$INSTDIR" "$SENDTO" error 0
StrCmp "$INSTDIR" "$RECENT" error 0
StrCmp "$INSTDIR" "$FAVORITES" error 0
StrCmp "$INSTDIR" "$PROGRAMFILES\Internet Explorer" donot 0
StrCmp "$INSTDIR" "$PROGRAMFILES\Uninstall Information" cannot 0



.....
.....
.....
..............

cannot: HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "¸ÃĿ¼ÊÇWindowsInstallerµÄ°²×°±¸·ÝĿ¼£¬\
Èç¹ûɾ³ý¿ÉÄÜÔì³É´íÎó£¬Ð¶ÔؽûÖ¹½øÐС£ "
Quit

error: HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "ÄúÏÖÔÚ½«Òª²Ù×÷µÄÊÇÒ»\
¸öϵͳÖØҪĿ¼£¬ÇëÎðÔÚ´ËÖ´ÐÐжÔسÌÐò¡£ "
Quit

....
....
....
FunctionEnd

;;;-----I like to run this codes in the un.onInit..


Split from unrelated thread.

What is the problem with the script you've posted? Does it not compile? Does it generate an error?