Archive: VERY strange bugs with delete


VERY strange bugs with delete
Hi!

I have very strange bugs here with delete. I have problems with beta3 and the actual CVS Version.

System: german WinXPsp1 with AthlonXP, german Win98SE (VMware)

There are bugs with WinXP/Win98 and bugs that appear on both systems:

1) Look at this script here (almost example1.nsi):

; example1.nsi
;--------------------------------

; The name of the installer
Name "Example1"

; The file to write
OutFile "example1.exe"

; The default installation directory
InstallDir $PROGRAMFILES\Example1

; The text to prompt the user to enter a directory
DirText "This will install the very simple example1 on your computer. Choose a directory"

;--------------------------------

; The stuff to install
Section "" ;No components page, name is not important
;CreateShortCut "$SMPROGRAMS\bla.lnk" "c:\command.com" "" "" 0 "SW_SHOWMINIMIZED" ;delete is not working WinXP/Win98

CreateShortCut "$SMPROGRAMS\bla.lnk" "c:\command.co" "" "" 0 "SW_SHOWMINIMIZED" ;delete is working WinXP/Win98

delete "$SMPROGRAMS\bla.lnk"
SectionEnd ; end the section


On both systems same behaviour (note that under XP there is neither c:\command.com or c:\command.co): In the first case delete does not its job, in the second case, created file is deleted

2) I have a rather complex script here: ~400 lines. It is the reason why I began to test delete. Here is the following situation:

The line:
delete "$SMPROGRAMS\Autostart\${BAT_NAME}.lnk"

DOES work under WinXP, but DOES NOT work under Win98.

I have a german OS, so my 1st thought was of foreign characters (startmenu is startmenü in german). But it seems, that this is not the problem.

If you are interested in the complete script tell me how to send/post it to you. 400 lines is nothing I want to post directly here without asking first

=> So, are these things a bug or do I need much sleep now?

Thank you in advance...


You can attach .nsi files to forum posts, attach your script that way.


OK. Here it is...

All things needed in the ZIP file...

A few parts are not in English; i hope it's not a big problem....

The line mentioned is in the Uninstall section...


The link have to be a .pif if link to DOS programs. (I beleave)


Indeed! Good point deguix! Windows creates .pif links to DOS programs. That's why you can't delete the link that links to a program with a .com extension, it has a .pif extension. When you removed the m from the extension Windows didn't think it was a DOS program any more and created a .lnk and not a .pif, that's why it worked.

Good catch deguix.


Oh man... it was that simple? I'm crying... I will go and try...


Yes you are right!! It is working now...

Because I sometimes force the detected OS to be Win98 (under WinXP) for testing purposes, I replaced

CreateShortCut "$SMPROGRAMS\Autostart\${BAT_NAME}.lnk" "$SYSDIR\${BAT_NAME}" "" "" 0 "SW_SHOWMINIMIZED"

with

CreateShortCut "$SMPROGRAMS\Autostart\${BAT_NAME}.pif" "$SYSDIR\${BAT_NAME}" "" "" 0 "SW_SHOWMINIMIZED"


and

delete "$SMPROGRAMS\Autostart\${BAT_NAME}.lnk"

delete "$SMPROGRAMS\Autostart\${BAT_NAME}.pif"
delete "$SMPROGRAMS\Autostart\${BAT_NAME}.lnk"

In this way I can be sure, that my shortcut is deleted under both systems. As you said: for programs mit .com extension CreateShortCut makes a PIF (WindowsXP as well as Win98); for batch programs CreateShortcut make under WinXP a lnk, under Win98 a .PIF file...

Thank you very much...