Nsis Error Handling
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NSIS- Error handling up vote 0 down vote favorite I have written an installer and uninstaller in NSIS which creates and drops an sql database, which is working fine. I have written some .bat and .sql files to create and drop the database and then just call these files from NSIS script. My problem is if I keep this database open in SQL Server Management Studio and run the uninstaller ideally it should give an error message that the database is opened. In my case it shows the success message of uninstaller but dosnt drop the database properly. How can I handle this error in NSIS? sql database nsis sql-drop share|improve this question edited Dec 13 '13 at 12:59 Midhun MP 45.6k1483142 asked Jan 8 '10 at 14:38 Pia 2231618 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote It depends on how you are calling these sql files from NSIS. Assuming you are using the SQL command line, you could use nsExec::ExecToStack to capture the output. Note the limitation on string length(which can be modified with one of the special builds of NSIS): http://nsis.sourceforge.net/Docs/nsExec/nsExec.txt Check for error on the top of the stack, which indicates if the command line returned a non-zero return code. If there is no error, you still need to parse the output of the sql command to see if there were errors logged there. You may need to pass paramters to the sql command line to specify verbose error output and whatnot. That will be up to you to experiment with and see what scenarios produce what output. I normally log the output from ExecToStack so t
help Register Rules Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion Nullsoft Error Handling User Name Remember Me? Password Thread Tools Search this Thread Display Modes 19th December 2007, 18:29 #1 slloyd Junior Member Join Date: Dec 2007 Posts: 23 Discussion on Nullsoft Error Handling I was hoping to start a discussion on error handling. I have been using nullsoft for quite some time and still find it quite difficult, if not impossible, to determine what causes some errors. I am interested in how others are handling errors and whether or not they feel the error handling in nullsoft lacking. Mostly, I would love to be able to capture the windows error(number or message) for errors. http://stackoverflow.com/questions/2028243/nsis-error-handling Some examples of problems I have had are:CopyFiles errors: Copy failed when the file on a CD had a crc error. The script called CopyFiles on a directory with many files so I was unable to determine what one failed. The only way I was able to determine what happened is to manually try to copy each file from the CD until I saw the windows error. RegDLL errors: Unable to see the failure message when registering a dll or http://forums.winamp.com/showthread.php?t=283441 ocx file. It would sure be nice to capture the windows error on this one also. slloyd View Public Profile Visit slloyd's homepage! Find More Posts by slloyd 19th December 2007, 19:08 #2 carlosfocker Junior Member Join Date: Apr 2006 Location: USA Posts: 40 I agree that error handling should be beefed up. Making your installer easy to troubleshoot is i feel an important aspect to consider while coding your installer. A suggestion would be able to set a type of error rather than a generic one. Kind of like a sudo exception. Then you could check to see if FileNotFoundError was set. For my current error handling techniques, I include a detailedprint in the functions or macros I build to declare problems. An example would be: code: StrCpy $R0 "c:\test\file.txt" IfFileExists $R0 FileExists FileNotExists FileExists: FileNotExists: detailprint 'Error: $R0 does not exist.' Building this into my macros at least gives me some type of clue when it fails. Also, to centralize my error catching and notification, I created a macro that checks if errors were set and prints a specified message in the installer console or a messagebox. carlosfocker View Public Profile Visit carlosfocker's homepage! Find More Posts by carlosfocker 23rd February 2008, 11:52 #3 kichik M.I.A.[NSIS Dev, Mod] Join Date: Oct 2001 Location: Israel Posts: 11,342 End of discussion? NSIS FAQ | NSIS Home Page | Donate $ "I hear
Français Hrvatski Italiano Magyar Nederlands Norsk Polski Português Română Slovenčina Suomi Svenska Tiếng Việt Türkçe Ελληνικά Български език Русский Српски Українська мова עִבְרִית العربية فارسی मराठी हिन्दी https://twitter.com/nsis_tweets/status/411485338297966592 বাংলা ગુજરાતી தமிழ் ಕನ್ನಡ ภาษาไทย 한국어 日本語 简体中文 繁體中文 Have an account? https://www.amazon.com/forum/kindle%20publishing?_encoding=UTF8&cdForum=Fx21HB0U7MPK8XI&cdThread=Tx1LQXZR6KVL9UZ Log in Have an account? Remember me · Forgot password? New to Twitter? Sign up nsis_tweets's profile NSIS @nsis_tweets NSIS @nsis_tweets Automated tweets about Nullsoft Scriptable Install System (NSIS): new releases, discussion, related downloads. Joined January 2013 © 2016 Twitter About Help Terms Privacy Cookies Ads info Dismiss nsis error Close Previous Next Close Go to a person's profile Saved searches Remove Verified account @ Suggested users Verified account @ Verified account @ Close Retweet this to your followers? Optional comment for Retweet Saved searches Remove Verified account @ Suggested users Verified account @ Verified account @ 140 Retweet Tweet Close Are you sure you want to delete this nsis error handling Tweet? Cancel Delete Close Promote this Tweet Close Block Cancel Block Add a location to your Tweets When you tweet with a location, Twitter stores that location. You can switch location on/off before each Tweet and always have the option to delete your location history. Learn more Turn location on Not now Close Profile summary Close Your lists Close Create a new list List name Description Under 100 characters, optional Privacy Public · Anyone can follow this list Private · Only you can access this list Save list Close Close Copy link to Tweet Here's the URL for this Tweet. Copy it to easily share with friends. Close Embed this Tweet Embed this Video Add this Tweet to your website by copying the code below. Learn more Add this video to your website by copying the code below. Learn more Hmm, there was a problem reaching the server. Try again? Include parent Tweet Include media Preview Close Log in to Twitter Remember me · Forgot password? Don't have an account? Sign up » Close Sign up for Twitter Not
Clothing, Shoes & Jewelry Women Men Girls Boys Baby Collectibles & Fine Art Computers Courses Credit and Payment Cards Digital Music Electronics Gift Cards Grocery & Gourmet Food Handmade Health, Household & Baby Care Home & Business Services Home & Kitchen Industrial & Scientific Kindle Store Luggage & Travel Gear Luxury Beauty Magazine Subscriptions Movies & TV Musical Instruments Office Products Patio, Lawn & Garden Pet Supplies Prime Pantry Software Sports & Outdoors Tools & Home Improvement Toys & Games Vehicles Video Games Wine Go Departments Hello. Sign inYour AccountSign inYour AccountTry PrimeListsCart0 Your Amazon.comToday's DealsGift Cards & RegistrySellHelp (What are Customer Discussions?) Customer Discussions Kindle Publishing forum Showing 1-25 of 737 discussions Discussion Replies Latest Post Announcement Kindle Publishing Guidelines Updated 1 5 hours ago Announcement Announcing Kindle Previewer 2.94 39 3 days ago Announcement Announcing Kindle Previewer 2.92 61 May 11, 2016 Announcement Announcing Kindle Publishing Tools 2.91 58 Oct 2, 2015 Image size confusion for Kindle Kid's Book Creator 18 1 day ago Marathi on kindle? 8 2 days ago Amazon launches new Kindle Previewer 3 (Beta) 4 3 days ago Kindle Comic Creator doesn't work 30 4 days ago background 0 4 days ago Enhanced Typesetting 0 15 days ago kindlegen wont launch 1 17 days ago kindle textbook creator - preview on devices? 5 19 days ago What is the best image proportion for kindle? 0 22 days ago The following document ... could not be delivered to the Kindle you specified 2 23 days ago How reliable is preview function in the Kindle Kids' Book Creator? 1 23 days ago Kindle Comic Creator does not recognize jpg files 1 23 days ago MOBI is resizing my images 2 23 days ago "document identifier" in kindlegen (epub -> mobi) 12 24 days ago Transparent png images in Kindle - Yes or No? 6 24 days ago Kindle Previewer Won't Open in Mac OS Lion 37 24 days ago The table of content c