See patch [971471]. I think this clears up a lot of issues. Mike and
Alex, this one replaces the one I sent earlier. Please comment.
Andy
Alex Burger wrote:
[EMAIL PROTECTED] wrote:
I have a question regarding the NSIS installer functions
that create the .bat files for snmpconf, mib2c, and traptoemail.
I'll show the fragment for snmpconf; Know that the others have
similar constructs.
-=-=-=-=-=-=-
StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf$\r$\n" 0 +3
FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf$\r$\n"
Goto snmpconfloop
StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf" 0 +3
FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf"
Goto snmpconfloop
-=-=-=-=-=-=-
In the last package, snmpconf.bat was broken, but mib2c.bat
and traptoemail.bat were not. In that case, snmpconf.bat
contained this after an install to base directory "c:/usr"
-=-=-=-=-=-=-
c:\usr\
-=-=-=-=-=-=-
QUESTION:
Since the NSIS functions are
almost identical for these three ".bat" files, what accounts
for snmpconf.bat breaking ? Was something _not_ translating
UNIX line terminator into DOS CRLF line terminator ?
The reason snmpconf.bat contained c:\usr\ is because of a step I
followed from the README. I have corrected the README and submitted a
patch already. The c:\usr\ has nothing to do with the .nsi script not
working.
Mib2c.bat and traptoemail.bat were broken. If you installed to a path
other than c:\usr they were not updated.
Consider now the patch
[971222 ] Win32 installer script not modifying .bat files
which would add yet another condition (per each .bat) :
@@ -362,6 +362,9 @@
StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf$\r$\n" 0 +3
FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf$\r$\n"
Goto snmpconfloop
+ StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf$\n" 0 +3
+ FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf$\n"
+ Goto snmpconfloop
StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf" 0 +3
FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf"
Goto snmpconfloop
QUESTION:
Is this done because we don't know whether the file being read
came from some .ZIP or was pulled from CVS with a Windows CVS tool
or with a Unix CVS tool ? It seems the problem would only get
worse for other cases when sources would need to be translated.
I don't know why it worked before (if it did) but doesn't work now
unless the .bat files were changed to use different endlines..
Seeing as how Nullsoft is picky, we should check for both. Or better
yet, add a wildcard to the end of the line if it supports it. Andy?
Alex
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
--
--------------------------
Andy Smith, MCP
[EMAIL PROTECTED]
--------------------------
--- /d/home/asmith/src/net-snmp/win32/dist/installer/net-snmp.nsi Wed Jun 9
20:37:51 2004
+++ usr/net-snmp.nsi Fri Jun 11 17:33:37 2004
@@ -211,6 +211,10 @@
File "registeragent.bat"
File "unregisteragent.bat"
Call CreateAgentBats
+
+ CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Service"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Service\Register Agent Service.lnk"
"$INSTDIR\registeragent.bat"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Service\Unregister Agent Service.lnk"
"$INSTDIR\unregisteragent.bat"
NoService:
SectionEnd
@@ -238,16 +242,6 @@
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Net-SNMP Help.lnk"
"$INSTDIR\docs\Net-SNMP.chm"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\README.lnk" "$INSTDIR\README.txt"
-
- ; If we are on an NT system then install the service batch files.
- Call IsNT
- Pop $1
- StrCmp $1 0 NoServiceBats
-
- CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Service"
- CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Service\Register Agent Service.lnk"
"$INSTDIR\registeragent.bat"
- CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Service\Unregister Agent Service.lnk"
"$INSTDIR\unregisteragent.bat"
- NoServiceBats:
SectionEnd
Section -Post
@@ -359,11 +353,8 @@
snmpconfloop:
FileRead $0 $2
IfErrors done
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf$\r$\n" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf$\r$\n"
- Goto snmpconfloop
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf"
+ StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\snmpconf$\n" 0 +3
+ FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\snmpconf$\n"
Goto snmpconfloop
FileWrite $1 $2
Goto snmpconfloop
@@ -385,11 +376,8 @@
mib2cloop:
FileRead $0 $2
IfErrors done
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\mib2c$\r$\n" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\mib2c$\r$\n"
- Goto mib2cloop
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\mib2c" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\mib2c"
+ StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\mib2c$\n" 0 +3
+ FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\mib2c$\n"
Goto mib2cloop
FileWrite $1 $2
Goto mib2cloop
@@ -411,11 +399,8 @@
traptoemailloop:
FileRead $0 $2
IfErrors done
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\traptoemail$\r$\n" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\traptoemail$\r$\n"
- Goto traptoemailloop
- StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\traptoemail" 0 +3
- FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\traptoemail"
+ StrCmp $2 "set MYPERLPROGRAM=c:\usr\bin\traptoemail$\n" 0 +3
+ FileWrite $1 "set MYPERLPROGRAM=$INSTDIR\bin\traptoemail$\n"
Goto traptoemailloop
FileWrite $1 $2
Goto traptoemailloop