|
|
#1 |
|
Guest
Posts: n/a
|
Unistall only installed files
can anybody write an exmaple script for me
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
This has already been asked before. You can only do this by creating a list of files on installation (write to a file using FileOpen, FileWrite) and then read from this file on uninstallation and delete each file.
e.g. code: You will need the TrimNewLines function to be present also. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
how can i present TrimNewLines function ?
|
|
|
|
#4 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
|
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
how can i use this in script?
sorry i'm just 12
|
|
|
|
#6 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
To use TrimNewlines, just insert the code into your script.
For example, insert it at the end of the code Afrow UK provided.code: |
|
|
|
|
|
#7 | |
|
Guest
Posts: n/a
|
Quote:
|
|
|
|
|
#8 |
|
Guest
Posts: n/a
|
i've used un.TrimNewLines and FileWrite $INSTDIR "$OUTPATH\${FileName}$\r$\n" so no more problem about making setup but now uninstall.log is empty
|
|
|
|
#9 |
|
Guest
Posts: n/a
|
Script on Basic.nsi, but unistaller doesnt work.
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Sorry I updated my code above after you must have copied it. I have made some alterations so you'll have to copy and paste it again.
-Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#11 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
Sorry about the "un.TrimNewlines" problem - I did not look at the code to see where the TrimNewlines function was being used.
In your script the "FileOpen" command will fail to create the uninstall.log file if the $INSTDIR folder does not exist. One way to fix this is to change the -openlogfile section: Another problem is that the "File" macro uses $OUTPATH instead of $OUTDIR (you should have got some warnings about this when you compiled the script, eg unknown variable/constant "OUTPATH\file1.ext" detected, ignoring (macro:File:2)).code: To fix this change the line to These two changes will let your installer create the uninstsall.log file with the correct data.code: You'll need to add some code to the uninstaller to make it delete the uninstall.log file, the uninstall.exe program, the empty folders and the registry data (have another look at the original Basic.nsi script to see how to do this). [edit] Another thing that might cause problems is that the "File" macro can store the wrong information if you include a path instead of just a filename, e.g. ${File} "path\file7.ext" [/edit] |
|
|
|
|
|
#12 | |
|
Guest
Posts: n/a
|
code: i've used this code, only problem with $OUTPATH this is contents of uninstall.log Quote:
|
|
|
|
|
#13 | |
|
Guest
Posts: n/a
|
Quote:
|
|
|
|
|
#14 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Ah yes sorry about that. I meant to put $OUTDIR but I put $OUTPATH instead sorry
![]() I never actually tested the code (although I should have). It was written here and then. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#15 |
|
Guest
Posts: n/a
|
is this possible for registry strings too?
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|