Author Topic: NSIS problem  (Read 17889 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
NSIS problem
« on: 2005-07-14, 09:22:20 PM »
i think theres a problem with compressing games in hte new version
im getting the error message
Code: [Select]
Error in macro UpgradeDLL on macroline 62
Error in script "C:\Documents and Settings\User\Desktop\ChameleonMan.nsi" on line 42 -- aborting creation process


i think its the new version's fault cuz it says UpgradeDLL is where the error is
let me know if i should post the entire log file from the script


---added later----
u kno what, ill post it anyway

Code: [Select]
MakeNSIS v2.07 - Copyright 1999-2005 Nullsoft, Inc.

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler (zlib).
Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).
Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).

Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.

Processing config:
Processing plugin dlls: "C:\Program Files\NSIS\Plugins\*.dll"
 - TypeLib::GetLibVersion
 - TypeLib::Register
 - TypeLib::UnRegister
 - Banner::destroy
 - Banner::getWindow
 - Banner::show
 - LangDLL::LangDialog
 - nsExec::Exec
 - nsExec::ExecToLog
 - nsExec::ExecToStack
 - Splash::show
 - AdvSplash::show
 - BgImage::AddImage
 - BgImage::AddText
 - BgImage::Clear
 - BgImage::Destroy
 - BgImage::Redraw
 - BgImage::SetBg
 - BgImage::SetReturn
 - BgImage::Sound
 - InstallOptions::dialog
 - InstallOptions::initDialog
 - InstallOptions::show
 - Math::Script
 - NSISdl::download
 - NSISdl::download_quiet
 - System::Alloc
 - System::Call
 - System::Copy
 - System::Free
 - System::Get
 - System::Int64Op
 - System::Store
 - StartMenu::Init
 - StartMenu::Select
 - StartMenu::Show
 - UserInfo::GetAccountType
 - UserInfo::GetName
 - Dialer::AttemptConnect
 - Dialer::AutodialHangup
 - Dialer::AutodialOnline
 - Dialer::AutodialUnattended
 - Dialer::GetConnectedState
 - VPatch::vpatchfile

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\Documents and Settings\User\Desktop"

Processing script file: "C:\Documents and Settings\User\Desktop\ChameleonMan.nsi"
!include: "C:\Program Files\NSIS\Include\MUI.nsh"
!include: "C:\Program Files\NSIS\Contrib\Modern UI\System.nsh"
NSIS Modern User Interface version 1.72 -  2002-2005 Joost Verburg (C:\Program Files\NSIS\Contrib\Modern UI\System.nsh:11)
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\Program Files\NSIS\Include\MUI.nsh"
!include: "C:\Program Files\NSIS\Include\UpgradeDLL.nsh"
!define: "UPGRADEDLL_INCLUDED"=""
!include: closed: "C:\Program Files\NSIS\Include\UpgradeDLL.nsh"
Name: "ChameleonMan"
OutFile: "ChameleonManInst.exe"
InstallDir: "$PROGRAMFILES\ChameleonMan"
InstallRegKey: "HKLM\SOFTWARE\ChameleonMan\Install_Dir"
!define: "MUI_FINISHPAGE_NOAUTOCLOSE"=""
!insertmacro: MUI_PAGE_WELCOME
!insertmacro: end of MUI_PAGE_WELCOME
!insertmacro: MUI_PAGE_DIRECTORY
!insertmacro: end of MUI_PAGE_DIRECTORY
!insertmacro: MUI_PAGE_INSTFILES
!insertmacro: end of MUI_PAGE_INSTFILES
!insertmacro: MUI_PAGE_FINISH
!insertmacro: end of MUI_PAGE_FINISH
!insertmacro: MUI_UNPAGE_CONFIRM
!insertmacro: end of MUI_UNPAGE_CONFIRM
!insertmacro: MUI_UNPAGE_INSTFILES
!insertmacro: end of MUI_UNPAGE_INSTFILES
!insertmacro: MUI_LANGUAGE
!insertmacro: end of MUI_LANGUAGE
Section: "Required Components"
!define: "VBFILESDIR"="C:\WINDOWS\System32"
!insertmacro: UpgradeDLL
Push: $R0
Push: $R1
Push: $R2
Push: $R3
Push: $R4
Push: $R5
!define: "UPGRADEDLL_UNIQUE"="42.9"
SetOverwrite: try
StrCpy $R4 "$SYSDIR\Comcat.dll" () ()
StrCpy $R5 "$SYSDIR" () ()
IfFileExists: "$R4" ? 0 : upgradedll.copy_42.9
ClearErrors
GetDLLVersionLocal: C:\WINDOWS\System32\Comcat.dll (327680,170393601)->($R0,$R1)
GetDLLVersion: $R4->$R2,$R3
IfErrors ?upgradedll.upgrade_42.9:
IntCmpU $R0:$R2 equal=0, < upgradedll.done_42.9, > upgradedll.upgrade_42.9
IntCmpU $R1:$R3 equal=upgradedll.done_42.9, < upgradedll.done_42.9, > upgradedll.upgrade_42.9
UnRegDLL: "$R4"
ClearErrors
StrCpy $R0 "$R4" () ()
Call ":upgradedll.file_42.9"
IfErrors ?0:upgradedll.noreboot_42.9
GetTempFileName -> $R0
Call ":upgradedll.file_42.9"
Rename: /REBOOTOK $R0->$R4
GetTempFileName -> $R0
File: "C:\Program Files\NSIS\Contrib\Library\RegTool\RegTool.bin" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in macro UpgradeDLL on macroline 62
Error in script "C:\Documents and Settings\User\Desktop\ChameleonMan.nsi" on line 42 -- aborting creation process


also, line 42 of the script is
Code: [Select]
  !insertmacro UpgradeDLL ${VBFILESDIR}\Msvbvm60.dll $SYSDIR\Msvbvm60.dll $SYSDIR
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
NSIS problem
« Reply #1 on: 2005-07-15, 06:07:55 AM »
If you're using a version of NSIS newer than 2.0, maybe this page will help:
http://nsis.sourceforge.net/wiki/How_to_install_the_VB6_runtimes

GameDev's Install packager is designed for NSIS 2.0.

Actually I would suggest you simply delete the sections for installing and un-installing VB runtime files since by now practically every system will already have them, and your package will be much smaller without them.  Just delete every line that has a $SYSDIR on it, and every other line of code in the same block.  By that I mean, you will see "blocks" of code separated by blank lines.  When you see a $SYSDIR in the script, just delete the entire block of code that contains it.

However, if you want to take the page's suggestion and make a new version of the script for the more recent NSIS, try the following (I haven't tested this):
1. Replace
Code: [Select]
!include "UpgradeDLL.nsh" with
Code: [Select]
!include Library.nsh
2. Replace
Code: [Select]
  ; VB Runtime Files
   CopyVBSysFiles:  
   !insertmacro UpgradeDLL ${VBFILESDIR}\Comcat.dll $SYSDIR\Comcat.dll $SYSDIR
   !insertmacro UpgradeDLL ${VBFILESDIR}\Msvbvm60.dll $SYSDIR\Msvbvm60.dll $SYSDIR
   !insertmacro UpgradeDLL ${VBFILESDIR}\Oleaut32.dll $SYSDIR\Oleaut32.dll $SYSDIR
   !insertmacro UpgradeDLL ${VBFILESDIR}\Olepro32.dll $SYSDIR\Olepro32.dll $SYSDIR

   !define UPGRADEDLL_NOREGISTER
      !insertmacro UpgradeDLL ${VBFILESDIR}\Asycfilt.dll $SYSDIR\Asycfilt.dll $SYSDIR
      !insertmacro UpgradeDLL ${VBFILESDIR}\Stdole2.tlb $SYSDIR\Stdole2.tlb $SYSDIR
   !undef UPGRADEDLL_NOREGISTER

   ; Referenced Microsoft Files and ActiveX Controls
   !insertmacro UpgradeDLL ${VBFILESDIR}\Comdlg32.ocx $SYSDIR\Comdlg32.ocx $SYSDIR
   !insertmacro UpgradeDLL ${VBFILESDIR}\MSComCtl.ocx $SYSDIR\MSComCtl.ocx $SYSDIR

   ; Only increase DLL count on new installation
   IfFileExists $INSTDIR\GDPlay.exe skipAddSharedDLL
      Push $SYSDIR\Asycfilt.dll
      Call AddSharedDLL
      Push $SYSDIR\Comcat.dll
      Call AddSharedDLL
      Push $SYSDIR\Msvbvm60.dll
      Call AddSharedDLL
      Push $SYSDIR\Oleaut32.dll
      Call AddSharedDLL
      Push $SYSDIR\Olepro32.dll
      Call AddSharedDLL
      Push $SYSDIR\Stdole2.tlb
      Call AddSharedDLL
      ; Referenced Microsoft Files and ActiveX Controls
      Push $SYSDIR\Comdlg32.ocx
      Call AddSharedDLL
      Push $SYSDIR\MSComCtl.ocx
      Call AddSharedDLL
   skipAddSharedDLL:
with
Code: [Select]
  ; VB Runtime Files
   CopyVBSysFiles:
   ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the
   ;application is already installed.
   IfFileExists "$INSTDIR\GDPlay.exe" 0 new_installation
     StrCpy $ALREADY_INSTALLED 1
   new_installation:
 
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \
     "${VBFILESDIR}\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
     "${VBFILESDIR}\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
     "${VBFILESDIR}\olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
     "${VBFILESDIR}\comcat.dll"   "$SYSDIR\comcat.dll"   "$SYSDIR"
   !insertmacro InstallLib DLL    $ALREADY_INSTALLED REBOOT_PROTECTED \
     "${VBFILESDIR}\asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
   !insertmacro InstallLib TLB    $ALREADY_INSTALLED REBOOT_PROTECTED \
     "${VBFILESDIR}\stdole2.tlb"  "$SYSDIR\stdole2.tlb"  "$SYSDIR"
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \
     "${VBFILESDIR}\Comdlg32.ocx"  "$SYSDIR\Comdlg32.ocx"  "$SYSDIR"
   !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \
     "${VBFILESDIR}\MSComCtl.ocx"  "$SYSDIR\MSComCtl.ocx"  "$SYSDIR"

3. Replace
Code: [Select]
  Push $SYSDIR\Asycfilt.dll
   Call un.DecrementSharedDLL
   Push $SYSDIR\Comcat.dll
   Call un.DecrementSharedDLL
   Push $SYSDIR\Msvbvm60.dll
   Call un.DecrementSharedDLL
   Push $SYSDIR\Oleaut32.dll
   Call un.DecrementSharedDLL
   Push $SYSDIR\Olepro32.dll
   Call un.DecrementSharedDLL
   Push $SYSDIR\Stdole2.tlb
   Call un.DecrementSharedDLL

   Push $SYSDIR\Comdlg32.ocx
   Call un.DecrementSharedDLL
   Push $SYSDIR\MSComCtl.ocx
   Call un.DecrementSharedDLL
with
Code: [Select]
  !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
   !insertmacro UnInstallLib DLL    SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
   !insertmacro UnInstallLib TLB    SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\Comdlg32.ocx"
   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\MSComCtl.ocx"


Let us know if it works!  Other people have the same problem.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
NSIS problem
« Reply #2 on: 2005-07-15, 09:35:36 AM »
went through and deleted evrything with $SYSDIR in it, and got this. musta missed something.

Code: [Select]
Processed 1 file, writing output:
Adding plug-ins initializing function... Done!
warning: uninstall function "un.DecrementSharedDLL" not referenced - zeroing code (55-69) out

Error: could not resolve label "CopyVBSysFiles" in install section "Required Components" (0)
Error - aborting creation process


im gonna keep experimenting with it

------

had to remove the line
Code: [Select]
  MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "An error occurred copying VB runtime files" IDRETRY CopyVBSysFiles
n then it finished packaging the installer, and it works. oh, the log in NSIS gave me this
Code: [Select]
Using zlib compression.

EXE header size:               47104 / 34816 bytes
Install code:                   6824 / 22564 bytes
Install data:               24108649 / 92869236 bytes
Uninstall code+data:           10973 / 15267 bytes
CRC (0x53E3D6F6):                  4 / 4 bytes

Total size:                 24173554 / 92941887 bytes (26.0%)

2 warnings:
  uninstall function "un.DecrementSharedDLL" not referenced - zeroing code (55-69) out

  install function "AddSharedDLL" not referenced - zeroing code (448-458) out
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
NSIS problem
« Reply #3 on: 2005-07-17, 08:52:57 AM »
Those warnings would probably go away if you deleted the line near the top:
!include "UpgradeDLL.nsh"

Basically, you want to go through the process of replacing X with Y that I described above, except just do the delete part and replace it with nothing, I think.