hanenjom
18th November 2011 15:47 UTC
problem with uninstall.exe
Hi , plesase can you help me,
i have a problem with uninstaller.exe :(
On unistaller, i use a file hwo contain a list of folder and directories to delete, the path of this file is $INSTDIR\unistall.txt.
when I install the some kit in two diffrent path kit1 on c:\path1; and the file c:\path1\unistall.txt
and kit2 on c:\path2, and the file c:\path2\unistall.txt
when I wany uninstall kit1, i have on unsitalla.exe the path of the second kit, c:\path2\unistall.txt.
as if it is about to overwrite the new value of $INSTDIR every time I install a kit
Please help me.
DrO
18th November 2011 16:02 UTC
will you please make sure that you're posting a new thread in the correct part of the forum - is now the second time i've had to move a new thread made by you from the Winamp areas into the NSIS forum.
-daz
hanenjom
18th November 2011 16:07 UTC
thx
@ DrO ; thx :)
demiller9
18th November 2011 19:54 UTC
And please check for typos. I can't understand what your issue is.
hwo - wany - unsitalla.exe
hanenjom
21st November 2011 08:45 UTC
to uninstall the kit, I use a file "unistall.txt" which contains a list of files and directories to be deleted.
Section-post SEC0001
WriteRegStr HKLM "$ {REGKEYS}" Path $ INSTDIR
SetOutPath $ INSTDIR
WriteUninstaller $ INSTDIR \ uninstall.exe
WriteRegStr HKLM "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ (^ Name)" DisplayName "$ (^ Name)"
WriteRegStr HKLM "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ (^ Name)" DisplayIcon $ INSTDIR \ uninstall.exe
WriteRegStr HKLM "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ (^ Name)" UninstallString $ INSTDIR \ uninstall.exe
WriteRegDWORD HKLM "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ (^ Name)" 1 NoModify
WriteRegDWORD HKLM "SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ $ (^ Name)" NoRepair 1SectionEnd
Section "Uninstall"
SectionIn RO
StrCpy $ line "" FileOpen $ uninstall "$ INSTDIR \ uninstall.txt" r
read:
FileRead $ uninstall $ line
StrCmp $ line "" done
StrFilter $ {} $ line "" "" "$ \ r $ \ n" $ line
Rmdir / r "$ line"
Delete $ line
Goto read
done:
FileClose $ uninstall
Delete "$ INSTDIR \ uninstall.txt"
DetailPrint "****"
SectionEnd
in the normal case the uninstall worked great, but when I install the kit twice in two different ways, for exmple the first installation in c: \ path1, we will have the file c: \ path1 \ unistall. txt
and the second installation in c: \ path2 and the file c: \ path2 \ unistall.txt
when I run the uninstall kit1 I unsitall.exe on the path of the second kit, c: \ path2 \ unistall.txt.
it overwrites the first pah and he supports the new path of the second kit, the i will Have a faulty process to uninstall
Please help me
MSG
21st November 2011 10:01 UTC
Because you are storing the uninstall information in exactly the same place for both installations, of course you cannot have two uninstallation items in your Add/Remove Programs window.
What you need to do is store the uninstall information in separate locations for both installations.
For example, in pseudo-code:
If uninstall information already exists in registry
andif installpath in registry is different from our $instdir
then write uninstall information to a different name. For example: "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)1"
However, if you do this you need to store the new registry name in your uninstaller, otherwise it won't know what registry entries to delete. You can do this with the ReadCustomerData function.