El comando NSIS DELETE no funciona

I am deploying gstreamer winbuilds along side an application. The main problem is that the gstreamer winbuilds installation is broken. The python bindings don't work and it complains every time you initialize gstreamer with annoying popups. So, I figured out that I could just delete the "libgstpython-v2.6.dll" from the lib folder to fix the problem. However, NSIS will not delete the file. Note, I am certain that the path is correct.

Aquí está el código:

ReadRegStr $0 HKLM 'SOFTWARE\OSSBUILD\GStreamer' InstallDir
ReadRegStr $3 HKLM 'SOFTWARE\Wow6432Node\OSSBUILD\Gstreamer' InstallDir

${If} $0 == '' 
 ${AndIf} $3 == ''
    DetailPrint 'The HHPVideoServer plugin depends on Gstreamer, we will need to install the core Gstreamer Components.'
    DetailPrint 'Installing Gstreamer.'
    ExecWait '"msiexec" /i "$INSTDIR\GStreamer-WinBuilds-GPL-x86-Beta04-0.10.7.msi" /q /norestart' $1
    DetailPrint 'Finished installing Gstreamer with error code $1' 

    ReadRegStr $0 HKLM 'SOFTWARE\OSSBUILD\GStreamer' InstallDir
    ReadRegStr $3 HKLM 'SOFTWARE\Wow6432Node\OSSBUILD\Gstreamer' InstallDir

    ${If} $0 != ''
        DetailPrint 'Gstreamer Plugins installed to $0'
        DetailPrint 'Deleting $0lib\gstreamer-0.10\libgstpython-v2.6.dll'
        DELETE '$0lib\gstreamer-0.10\libgstpython-v2.6.dll''
    ${ElseIF} $3 != ''
        DetailPrint 'Gstreamer Plugins installed to $3'
        DetailPrint 'Deleting $3lib\gstreamer-0.10\libgstpython-v2.6.dll'
       DELETE '$3lib\gstreamer-0.10\libgstpython-v2.6.dll'

    DetailPrint 'Gstreamer already installed.'

The delete call never works. If I manually delete the file, it fixes the error messages for gstreamer. Also, the installer is running with administrator permissions.

preguntado el 24 de agosto de 12 a las 07:08

1 Respuestas

Hi can you just do a quick test?

Add the following lines after you make the delete calls in both places:

IfErrors 0 +2
DetailPrint 'There was an error trying to delete the file!'

This will let us know if it is trying to delete the file and it can't or if it is not finding the file. Delete only throws an error when it finds the file AND it can't delete it.

If you do end up getting an error then the next step is trying to figure out what program or service is using the DLL when you try to delete it.

Respondido 24 ago 12, 19:08

Actually, I just discovered that the SDK installer actually puts libgstpython*.dll into the lib directory. So, the file wasn't there yet, I just moved the code to the section installing the SDK and that took care of it. Thank you for your help, it actually triggered it in my mind that that was probably the issue. - jonathan henson

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.