I've been testing with the QuickPortTemplate_v1.1 code but i always get an error with the Messagebox::show command here
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Section "Main"
;Check machine for local install and if found show a message box to choose what settings to use.
${registry::KeyExists} "${REGKEY}" $R0
StrCmp $R0 "0" 0 RunPortable
Messagebox::show "" "Local ${APPNAME} Installation Found..." "" " ${APPNAME} is currently Installed to the local machine.$\n Do you want to use your Portable Settings or the Local Settings?" "Portable Settings" "Local Settings" IDCANCEL
pop $0
StrCmp $0 "1" BackupLocal
StrCmp $0 "2" RunLocal
StrCmp $0 "3" End
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I would show a pic but I dont now how (i dont know html).
I was using Portable NSIS and then found
HM NIS Edit(using nsis compiler's engine)
http://portablefreeware.com/?q=nsis&m=Search
they both gave me the same error
it says
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
!insertmacro: end of regisrty::KeyExists
StrCmp "$RO" "0", nonequal=RunPortable
Invalid Command: MessageBox::show
Error In Script "F:\QuickPortTemplate_1.1\QuickPortableTemplate\....etc location of script" error in script on line 68
What am I doin wrong?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
In RegRapper Ive gottin it to make a couple of apps (I Recompiled the code and the icon) but i always get this error and i just delete some keys(which i know is bad!) and it works!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;----Functions----
Function RegCheck ;----Function to call RegSearch and check query results----
${RegSearch} ${ROOTKEY1} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $EXECUTABLE
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $EXECUTABLE
Return
goBack:
Return
FunctionEnd
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
It will work only if i delete all the keys except one like this...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Function RegCheck ;----Function to call RegSearch and check query results----
${RegSearch} ${ROOTKEY1} $DEVNAME
StrCmp $REGKEY "" 0 goBack
goBack:
Return
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I'm guessing since (since i dont now alot about code that the app is searching rootkey1(which is(HKEY_CURRENT_USER) for the devname.
If i delete all the other keys and leave one, it will work fine but im just making sure if i should delete keys like that but if i dont change any thing it will say this
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StrCmp "$0" "-1_ equal=0, nonequal=find
Error: label "find:" already decrlared in function
Error in macro RegSearch on macroline 4
Error in script "F:\.....and the location of the script"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I dont edit any code its the same as it was as i downloaded it, i change names or add names, decscriptions, versions, stuff like that you know since its a template but i dont fully understand code (yes im n00b dont hate) so im here to ask for help
So if anyone can tell me what im doin wrong it would help alot thanks!
Quick-Port - If you unzipped the quickport zip without changing the folder structure, you will find a plugins folder. Within that folder you will find a MessageBox 0.93 zip. Copy the messagebox.dll to the ..\NSIS\Plugins folder. that will fix the problem with quickport.
As for Registry rapper. The regsearch.nsh include file is the problem. If you are using the 1.8 of Regrapper. I had changed the Include file for use with regrapper. To fix the probolem, open up the regsearch.nsh file found in ..\NSIS\Include with notepad, delete all text in it and copy the following code into the file:
Save the file and try to recompile that dshoudl fix the problem with regrapper.
Post back with any problems after trying this.
Sorry for your trouble.
***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.
Deuce
Portable Software: Just the beginning.
I tried what you said, with regrap and quick port. i have given up on quick port i compiled successfully butit didnt even launch the app. With regrap I changed the regsearch.nsh like you said and now it says at this area that regsearch is an invalid command(with all searches or only one like below . Idk what im doing wrong.Another Question is if I delete all but one regsearch like this
${RegSearch} ${ROOTKEY1} $DEVNAME
StrCmp $REGKEY "" 0 goBack
Will it still work? I have been(after successfully compiling it with it trimmed down to one "regsearch" like above) monitering the registry while running the portable app launcher and the app, it loads the registry file then deletes it after i close the app just like its supposed to?
Slackware 12 for system
MCP (For XP and Server 2003)
Network + Certified
aim is "nycjv321" (minus quotes)
Can you please post the compiler errors you are getting from regsear.nsh, it shoudl come up during compile time?
As for delting registry search settings. these are there to use all of the search terms to find the location in the registry that houses the registry settings. It is there so you do not need to search the registry for the settings entreies, it will do it for you. If using only the developer name, which is what $devname in the command means, woprks for you then use it.
This program is suppose to be an simple utility to automatically deal witht he registry settings for the program sot he user does not have to. A imple tool. The quickport template is for those situation where you know exactly where the settings are located
AS for quickport what is the problem?
***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.
Deuce
Portable Software: Just the beginning.
right here at funtions section with the new regsearch (like u said) this is the place it messes up
----------------------------------------------------------------------------------
;----Functions----
Function RegCheck ;----Function to call RegSearch and check query results----
${RegSearch} ${ROOTKEY1} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $EXECUTABLE
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $EXECUTABLE
Return
goBack:
Return
FunctionEnd
----------------------------------------------------------------------------------
it says this error
VIAddVersionKey: "FileVersion" "1.0"
Function: "RegCheck"
Invalid Command: $(RegSearch)
Error in Script "(the location of the script at line 74)"
line 74 is as follows -> ${RegSearch} ${ROOTKEY1} $DEVNAME
----------------------------------------------------------------------------------
As for quickport i have solved the problem. Thx alot for all this help!
Slackware 12 for system
MCP (For XP and Server 2003)
Network + Certified
aim is "nycjv321" (minus quotes)
Just to get my thoughts straight, you have the RegSearch.nsh file int he \NSIS\Includes folder?
You also have a line labeled "!include "RegSearch.nsh" under the includes section in the .nsi script itself?
The only thing I no this error occurs is because the Regsearch.nsh function is not being included. Could you please post the whole output of the NSIS compiler. not the HM NSIS one the striaght NSIS one. You shoudl be able to download Protable NSIS from Portasoft if you needed. I can then see where the problem lies.
Thanks,
***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.
Deuce
Portable Software: Just the beginning.
"!include "RegSearch.nsh" under the includes section in the .nsi script itself
well here is the script after attempting the compile it...
---------------------------------------------------------------------------------
MakeNSIS v2.14 - Copyright 1999-2006 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: "F:\Projects&Programming\PortableNSIS 1.5\PortableNSIS 1.5\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- LangDLL::LangDialog
- Math::Script
- NSISdl::download
- NSISdl::download_quiet
- Registry::_Close
- Registry::_CopyKey
- Registry::_CopyValue
- Registry::_CreateKey
- Registry::_DeleteKey
- Registry::_DeleteKeyEmpty
- Registry::_DeleteValue
- Registry::_Find
- Registry::_HexToStr
- Registry::_KeyExists
- Registry::_MoveKey
- Registry::_MoveValue
- Registry::_Open
- Registry::_Read
- Registry::_ReadExtra
- Registry::_RestoreKey
- Registry::_SaveKey
- Registry::_StrToHex
- Registry::_Unload
- Registry::_Write
- Registry::_WriteExtra
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- VPatch::vpatchfile
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "C:\Documents and Settings\Owner\Desktop"
Processing script file: "C:\Documents and Settings\Owner\Desktop\Portable UniExtractor.nsi"
!define: "SNAME"="RegRap"
!define: "SETDIR"="$EXEDIR\Settings"
!define: "CURRENT"="$EXEDIR\SETTINGS\Current.reg"
!define: "ROOTKEY1"="HKEY_CURRENT_USER"
!define: "ROOTKEY2"="HKEY_LOCAL_MACHINE"
!include: "F:\Projects&Programming\PortableNSIS 1.5\PortableNSIS 1.5\NSIS\Include\Registry.nsh"
!define: "registry::Open"="!insertmacro registry::Open"
!define: "registry::Find"="!insertmacro registry::Find"
!define: "registry::Close"="!insertmacro registry::Close"
!define: "registry::KeyExists"="!insertmacro registry::KeyExists"
!define: "registry::Read"="!insertmacro registry::Read"
!define: "registry::Write"="!insertmacro registry::Write"
!define: "registry::ReadExtra"="!insertmacro registry::ReadExtra"
!define: "registry::WriteExtra"="!insertmacro registry::WriteExtra"
!define: "registry::CreateKey"="!insertmacro registry::CreateKey"
!define: "registry::DeleteValue"="!insertmacro registry::DeleteValue"
!define: "registry::DeleteKey"="!insertmacro registry::DeleteKey"
!define: "registry::DeleteKeyEmpty"="!insertmacro registry::DeleteKeyEmpty"
!define: "registry::CopyValue"="!insertmacro registry::CopyValue"
!define: "registry::MoveValue"="!insertmacro registry::MoveValue"
!define: "registry::CopyKey"="!insertmacro registry::CopyKey"
!define: "registry::MoveKey"="!insertmacro registry::MoveKey"
!define: "registry::SaveKey"="!insertmacro registry::SaveKey"
!define: "registry::RestoreKey"="!insertmacro registry::RestoreKey"
!define: "registry::StrToHex"="!insertmacro registry::StrToHex"
!define: "registry::HexToStr"="!insertmacro registry::HexToStr"
!define: "registry::Unload"="!insertmacro registry::Unload"
!include: closed: "F:\Projects&Programming\PortableNSIS 1.5\PortableNSIS 1.5\NSIS\Include\Registry.nsh"
!include: "F:\Projects&Programming\PortableNSIS 1.5\PortableNSIS 1.5\NSIS\Include\RegSearch.nsh"
!include: closed: "F:\Projects&Programming\PortableNSIS 1.5\PortableNSIS 1.5\NSIS\Include\RegSearch.nsh"
CRCCheck: on
AutoCloseWindow: true
SilentInstall: silent
WindowIcon: off
XPStyle: on
Name: "Portable UniExtractor"
Icon: "UniExtractor.ico "
Error: File doesn't exist or is an invalid icon file
Error in script "C:\Documents and Settings\Owner\Desktop\Portable UniExtractor.nsi" on line 48 -- aborting creation process
----------------------------------------------------------------------------------
what you just saw is what nsis says after i dragged and dropped it onto nsis. Below is the complete nsi file before i compile it
----------------------------------------------------------------------------------
;Portable UniExtractor 1.0.0.0
;Copyright (C)
;2006 Jonathan Durant - Original Concept and main code
;2006 nm35 - Save current settings integration
;2006 David Carrington - ini file integration
;2006 Javier Velasquez - Tweaking the script for "Portable UniExtractor"
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
;GNU General Public License for more details.
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301, USA.
;---Definitions----
!define SNAME "RegRap"
!define SETDIR "$EXEDIR\Settings"
!define CURRENT "$EXEDIR\SETTINGS\Current.reg"
!define ROOTKEY1 "HKEY_CURRENT_USER"
!define ROOTKEY2 "HKEY_LOCAL_MACHINE"
;!define ROOTKEY3 "HKEY_CLASSES"
;----Includes----
!include "Registry.nsh"
!include "RegSearch.nsh"
;-----Runtime switches----
CRCCheck on
AutoCloseWindow True
SilentInstall silent
WindowIcon off
XPSTYLE on
;-----Set basic information-----
Name "Portable UniExtractor"
Icon "UniExtractor.ico "
Caption "Portable UniExtractor 1.0"
OutFile "${SNAME}.exe"
;-----Variables----
Var REGFILE
Var REGKEY
Var APPNAME
Var DEVNAME
Var PROGDIR
Var EXECUTABLE
;-----Version Information------
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
VIProductVersion "1.8.0.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Portable UniExtractor"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© Javier Velasquez 2006"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Allows portability of Portable UniExtractor."
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.0"
;----Functions----
Function RegCheck ;----Function to call RegSearch and check query results----
${RegSearch} ${ROOTKEY1} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY1} $EXECUTABLE
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $DEVNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $APPNAME
StrCmp $REGKEY "" 0 goBack
${RegSearch} ${ROOTKEY2} $EXECUTABLE
Return
goBack:
Return
FunctionEnd
;----Main section----
Section "Main"
;Read Program settings
IfFileExists ${SETDIR}\${SNAME}.ini INIExists NoINI
INIExists:
ReadINIStr $DEVNAME "${SETDIR}\${SNAME}.ini" "PROGSETTINGS" "DEVNAME"
ReadINIStr $APPNAME "${SETDIR}\${SNAME}.ini" "PROGSETTINGS" "APPNAME"
ReadINIStr $EXECUTABLE "${SETDIR}\${SNAME}.ini" "PROGSETTINGS" "EXECUTABLE"
ReadINIStr $REGFILE "${SETDIR}\${SNAME}.ini" "REGSETTINGS" "REGFILE"
ReadINIStr $PROGDIR "${SETDIR}\${SNAME}.ini" "DIRSETTINGS" "PROGRAMDIRECTORY"
ReadINIStr $REGKEY "${SETDIR}\${SNAME}.ini" "REGSETTINGS" "MANREGKEY"
goto iniCheck
NoINI:
Messagebox MB_OK " No ${SNAME}.ini file found.$\nPlease see readme.txt for more information."
goto end
;Check for problems with INI
iniCheck:
StrCmp $EXECUTABLE "" empty BUandRestore
empty:
Messagebox MB_OK " No Application Executable set in the ${SNAME}.ini file.$\nPlease fill in this information for this program to work correctly."
Goto End
;Backup current program settings and restore personal registry settings
BUandRestore:
StrCmp $REGKEY "" 0 +2
call RegCheck
${Registry::SaveKey} "$REGKEY" "${CURRENT}" "/G=1" $R0
StrCmp $R0 0 0 +2
WriteINIStr "${SETDIR}\${SNAME}.ini" "REGSETTINGS" "MANREGKEY" $REGKEY
StrCmp $REGFILE "" ExecProgram 0
${Registry::RestoreKey} "$REGFILE" $R0
goto ExecProgram
; Start program
ExecProgram:
ExecWait $PROGDIR\$EXECUTABLE.exe
goto SearchRegistry
;Find Registry Settings
SearchRegistry:
StrCmp $REGKEY "" 0 saveRegKey
call RegCheck
goto saveRegKey
;Check search results and export registry key
saveRegKey:
StrCmp $REGKEY "" error save
error:
Messagebox MB_OK "Unfortunately no registry entry could be found within the search criteria.$\nPlease read the 'Finding Registry Key Info' section in the readme.txt file."
goto end
save:
StrCmp $REGFILE "" create overwrite
create:
${Registry::SaveKey} "$REGKEY" "${SETDIR}\Settings.reg" "/G=1" $R0
${Registry::DeleteKey} "$REGKEY" $R0
${Registry::RestoreKey} "${CURRENT}" $R0
Sleep 500
Delete ${CURRENT}
goto saveINIdata
overwrite:
Delete ${SETDIR}\$REGFILE
${Registry::SaveKey} "$REGKEY" "$REGFILE" "/G=1" $R0
${Registry::DeleteKey} "$REGKEY" $R0
${Registry::RestoreKey} "${CURRENT}" $R0
Sleep 500
Delete ${CURRENT}
goto saveINIdata
saveINIdata: ;Write found information to INI file
WriteINIStr "${SETDIR}\${SNAME}.ini" "REGSETTINGS" "REGFILE" "Settings\Settings.reg"
WriteINIStr "${SETDIR}\${SNAME}.ini" "REGSETTINGS" "MANREGKEY" $REGKEY
goto End
End:
abort ;forces program end
SectionEnd
----------------------------------------------------------------------------------
ok here thx agian for all the help tell me what im doing wrong ok...
Slackware 12 for system
MCP (For XP and Server 2003)
Network + Certified
aim is "nycjv321" (minus quotes)
Try a older version of the registry plugin.
I had similiar problems with the newest plugin (v3.0) but it compiled using the older v2.7
Download the latest Registry Plugin here
http://nsis.sourceforge.net/Registry_plug-in
Older versions are in this thread
http://forums.winamp.com/showthread.php?s=&threadid=223066
gl
with 3.0 is that the regsearch function and the regsitry commands used were originally created using the 2.7 or below plugin versions. I had stopped working on it for awhile after that and it has not been updated for the newer version. Really it has to do due with the variables for the different commands, such as registry::find now needs 5 variables and nbot four. THe registry plugin comes with a readme file, but unfortunately it is not very thorough, it does give all the commands and description, just not very readable. I usually read it twice or three times before I fully understand this.
I have been looking at trying to get time to update regrap and quickport with the newer version and finding a way to optimize the regsearch function further, but time of little freedom to me.
I am trying though. I will keep you updated on my progress.
again, sorry for the long break between updates.
***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.
Deuce
Portable Software: Just the beginning.
sorry it took so long to get back to you on this.
The reason you are getting the error is due to the uniextracter.ico missing from the location on the .nsi file. by default nsis is going to be looking in the same folder as the .nsi file. so make sure that the ico file is located there and named exactly as it states in the script, and that should get rid of that error.
let me know what happens.
***********************************
Deuce {The Core}{Dev Blog}
Portable Software: Just the beginning.
Deuce
Portable Software: Just the beginning.
thx well i finally figured out that thas the icon was the problem. So it compiled after i fixed it! But after testing and searching the registry for new entrys i found that the apps that uniextract uses such as peid or unrar use the registy so i switched to Portable App Template since it handles more then one registry key i do use quick port for apps that use one key all the time. And also another thing that uniextract make as a log is unixtract.txt in the root of the c:\ drive so I took the AutoIt code and changed it now it seams it logs in the exedir or the directory of the exe u extracted, im still messing with that. Thx so much for all youre help.
;idea for quick port template 1.2 or 2.0:
one thing that would be cool to have is the use of ini ;---that would be pretty ;neat
or maybe the option to catch the registry use at the time the app uses it. Well these are just ideas thx agian!!!
Slackware 12 for system
MCP (For XP and Server 2003)
Network + Certified
aim is "nycjv321" (minus quotes)