Can I install postgresql8.2 via command prompt or running any batch or registry file? - windows

Is it possible to install the entire database(postgresql8.2) via command prompt or batch file or registry file bypassing the trivial procedure for installation. But then to a question comes that, how can we supply default parameters such as name,password,language,default location of database? Currently I'm working on 'Windows XP' platform.
Thank you.

For 8.3 and lower the obvious answer is: http://pginstaller.projects.pgfoundry.org/ which supports or supported silent installations. For more recent versions, please read: http://forums.enterprisedb.com/posts/list/2135.page
Use of existing installers would simplify your life and be where I would start.
This being said there is no reason you can't generate a script to register dll's properly run initdb, etc. This will take some extra knowledge of both PostgreSQL and Windows, and will be mostly suitable for custom solutions (i.e. not cases where you merely are packaging software that runs with PostgreSQL). I don't think an complete answer can be given here because once you need such a solution you need to design your installation around if. Books could be written on that topic. The docs http://www.postgresql.org/docs/9.0/static/install-windows.html should get you started however since the only difference really between installing from source and installing from the precompiled source is just that you need to compile the source files first.
Failing that you could take a look at the binary zip packages. Typically these can be extracted and PostgreSQL can be run from inside them.

Related

Need to change shebang for Strawberry Perl [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
This isn't so much a "question" as a methodology I found which I believe is working.
Most servers use the path "/usr/bin/perl" ... but Strawberry Perl (strawberryperl.com) use their own unique path of "/strawberry/perl/bin" (!!) (I tried installing into a different directory as allowed by the prompt, but it wouldn't work at all then! I read somewhere that some files within the installation are 'hardcoded' to the above path.)
I am not looking forward to having to rename all the shebangs of around 400 offline files, and then having to change them all again when uploaded, and I sought another solution. I found it in something called a "symbolic link".
Basically, it's an internal Windows redirect. It basically says "If you see the path as 'usr/bin/perl' then instead go to 'strawberry/perl/bin' " There are two ways to set this up.
The first is to open up a command line terminal ("CMD" in Windows search box, then click "cmd.exe") You use "cd.." to get back to the "C:>" prompt, and then enter "/d usr\bin\perl starwberry\perl\bin\perl.exe" and click enter. This will set up the <==> symbolic link. (Note directions of the slashes) That's OK for a one time use. (It may work without adding ".exe", but to be sure...)
But I design websites offline, so I need the redirect to be set up each time I boot up. You can do this as well with a batch file.
Using a text file, enter the same data as you did at the prompt, and save it as a ".bat" file to your startup folder, (as found in the left menu when clicking "Start" button lower left) You may well find other icons for programs that also initiate at startup within this folder.
I'm 99% certain this is working, because I went into the 'usr/bin/perl' and renamed the executable files as 'perl_old.exe' and 'perl_5.12.4_old.exe" and "wperl_old.exe" (so that if a Perl script DID access "usr\bin\perl" it wouldn't find any program to run) ... and the file still ran when I put URL into the browser.
So why the switch from ActiveState? I wanted to install a particular library. I tried it via PPM and was told I didn't have authorisation. No, this isn't an "Administrator Rights" issue of Windows; it's the fact that ActiveState now want to charge $999 for access to certain files. "Well, you can still use 'dmake' to create the files downloaded direct from CPAN" Er, no, you can't ... because "dmake" is one of the files under lock and key! And without that, you cannot install ANY file from CPAN. (The term "Holding You To Ransom" springs to mind.)
Using Strawberry Perl, it's just a case of starting a command line terminal, (CMD) moving back to the root (C:>) and typing "cpan". You now type "install MODULE::name". Boom! All the files for that particular module are downloaded and installed using the "make.pl" associated with that program.
We won't get into the debate of a company charging to access items in the public domain; they're a business after all.
I know this might be teaching your grandmother to such eggs to some of the more advanced users, but there may be other people on the verge of renaming all their files when switching to Strawberry Perl. Oh, I believe their program suite also include C, C++ and Fortran compilers (no, I've no idea either!). One downside: Due to all the extra program features they install, the directory is THREE TIMES LARGER than the "ActiveState" installation!
I'm pretty sure your problem with ActivePerl is that you're using an older version. I've just done:
C:\Users\myaccount\Documents>perl -MCPAN -e shell
It looks like you don't have a C compiler and make utility installed. Trying
to install dmake and the MinGW GCC compiler using the Perl Package Manager.
This may take a a few minutes...
Downloading ActiveState Package Repository dbimage...done
Downloading MinGW-4.6.3...done
Downloading dmake-4.11.20080107...done
Unpacking MinGW-4.6.3...done
Unpacking dmake-4.11.20080107...done
Generating HTML for MinGW-4.6.3...done
Generating HTML for dmake-4.11.20080107...done
Updating files in site area...done
2759 files installed
Please use the `dmake` program to run commands from a Makefile!
cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.
cpan>
Using version:
This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x86-multi-thread-64int
ActiveState has a policy of not keeping fully up to date on older versions, because of the support overhead. You can see - for example - their builds of dmake here:
https://code.activestate.com/ppm/dmake/
From their web page:
Looking for access to older versions of ActivePerl?
Community Edition offers access to the newest versions of ActivePerl.
Access to older versions (Perl 5.6, 5.8, 5.10, 5.12, 5.14, 5.16) is available in Business Edition and Enterprise Edition.
E.g. to use the version you're currently using (5.12), you'd need to buy support. But you could use 5.18 or 5.20 for free.
I would also note: Windows doesn't use shebang paths anyway; it uses file associations.

Windows installer is too clever, tries to repair when tester deletes config file

Our application is deployed to the target machine with an msi file. All works nicely. Our tester has gone through his plan, and one of the tests requires deleting the application's configuration file. The application is designed to alert the user with a dialog on startup saying "missing config". However, what happens is that - somehow! - the software starts the installer again and retrieves the missing file from the msi! Which is nice, but not what we want. How do we disable that behaviour?
without going into much depth of the windows installer mechanics (if you interested in that there a plenty of articles about this), the shortcut of the software is probably advertised, which means the windows installer checks if everything is in its place before the software is started.
if you can edit the msi, make the shortcut non advertised.
if you can't, install it with DISABLEADVTSHORTCUTS
e.g. msiexec /i myMsi.msi DISABLEADVTSHORTCUTS=1
please note that this is only a quick (and dirty) workaround,
to fix this proper you need to understand the whole windows installer advertising (also called repair or self resiliency) mechanism.
but explaining all the causes and the mechanism of the repair is far beyond this answer and there are quite some articles and posts about that on the internet (and especially on MSDN and stackoverflow)
There is a more correct answer to this, and it is NOT DISABLEADVTSHORTCUTS. You set the component id to null in the MSI file to prevent repair of that individual file. See ComponentId comments here:
http://msdn.microsoft.com/en-us/library/aa368007(v=vs.85).aspx
Edit the MSI file with Orca to delete the Componenty ID, and write an uninstall custom action to delete the file at uninstall if it's there.
In addition, that's a redundant test. Windows will restore that file for you if it's missing, so the idea that you need a test to notify that it's missing is pointless. The true test should be that Windows will restore the file if it's lost, and your app needs to do potentially nothing about the missing file.
You don't mention what tool you are using to make your MSI but I'm going to go out on a limb and guess Visual Studio Deployment Projects (.VDRPOJ).
One of the (many) horrible things about this tool was that it fails to expose the foundational concept of components. Instead it makes every file a key file of it's own component and hides the existence of the component from you. I say 'was' because Microsoft killed this project type in VS. There are around 50k people complaining on UserVoice to bring this tool back and I'm guessing that 49,990 of them don't know what a key path is.
Windows Installer has a concept called the component rules and each component has a keypath. The keypath teaches MSI how to handle repair scenarios. But your tool has to allow you to be able to control this to make it work.
Windows Installer is functioning exactly the way it's supposed to function. You just aren't up to speed on what that is.
However, if you want to ignore Windows Installer best practices and continue using the tool you use today, the trick is to install the app.config file as a different file. Then have the application copy the file to the real file name on run. Windows Installer won't service what it didn't install.
Several answers have been provided that can work:
You can install the file with a blank guid. Then you need to remove it on uninstall using the RemoveFile feature. You will also run into issues if you want to replace it during an upgrade. Could be tricky at times.
You can disable the advertised shortcut(s), but this affects too much in my opinion.
Finally you can use my suggestion to install a separate non-advertised shortcut to use to launch the application. Such a shortcut bypasses the self-repair check. It may still be invoked by other means such as missing file associations, COM registration or similar, but those are exception states.
However, my preference is that an application can start without a config file present, if at all possible. I always suggest a good startup routine with "internal defaults" available. The startup routine should also degrade gracefully if faced with any file system access denied conditions.
Most importantly you should place this config file in the userprofile so you can generate the file on first launch for the user in question. It can even be copied from a read-only copy in the main installation directory.
When you generate a file from internal defaults and put it in a userprofile location, the file will have no interference with Windows Installer at all. The issues that results is how to clean up user data on uninstall. I discussed this with Stefan Kruger (MSI MVP) at one point, and I agree with his notion that user data is indeed user data and should not be automatically dealt with by your installer at all. Leave it installed, and clean it up via system administrator tools if necessary - for example logon scripts.

Simple autoupdate. How can I run the installer and delete it after it's complete?

I want to create a simple autoupdate that downloads the new version of my software (in a temp folder), runs the installer (I'm using Innosetup) which will take care of closing my application and then, after the setup is complete, I would like to remove the installer file.
What's the best approach to do that?
I saw there are a number of libraries that take care of everything but I have written almost all the code used to check for updates and I'd just need to be able to run the installer.
Thanks a lot.
You can use the NAppUpdate framework to achieve that quite easily.
Check this out: http://www.sjurvarhaug.com/nappupdate-to-automatically-download-and-execute-installer

Find files created or modified by an installer

To track changes in OSX filesystem while an installer runs I'm trying to use the fs_usage.
Can somebody guide me with a simple example on how to interpret the result. There a lot of terms I don't understand when I examine it.
fs_usage's output tends to be full of irrelevant chatter, and hard to interpret. I'd recommend using fseventer, which just shows changed files without all the nonsense. If you're an Apple developer, you can also use PackageMaker's snapshot package feature (which records everything that happens, and offers to make an installer package that does the same things).

svn client binaries for windows

Where are the Windows binaries for the command-line version of SVN? Everywhere I search, it has to be some company's fancy client software with an installer.
I'm working on a machine where I don't have administrator account. Just give me the plain command-line binaries, where the hell are they?
The former direct links don't work, but the subversion project now provides several offsite links to Windows binaries:
http://subversion.apache.org/packages.html#windows
I use Slik SVN. It doesn't require a bunch of registration information like the CollabNet one does.
Get the version from Slik SVN, which doesn't require registration, and you should be able to install it anywhere you want (and have permissions).
If you can't run the installer, you could always try extracting the files from it using UniExtract, or possibly Total Commander with the MSI plugin.
You could always use cygwin and install the subversion package during install which would make it accessible in command prompt (with some $PATH changes) but I understand if this doesn't fit your criteria of 'just binaries'.
Edit: I understand why people are downvoting but it was just a last resort suggestion to getting the binaries for subversion. To answer the question 'why install all of cygwin if you just need subversion': I find that originally being a linux app that I'd be more comfortable using subversion in a *nix environment such as cygwin and could consequently leverage GNU utils such as find, grep, bash etc to perform file based operations, which subversion primarily deals with.
I suggested it because of this and I thought it would be the easiest and quickest way to get subversion as the OP had expressed dismay about finding legitimate binaries: a few clicks and you're done. It was a suggestion that was asked for and in my original comment I had the caveat of installing cygwin right there.
I have hust found this: http://alagazam.net/ . This is really the same project as http://sourceforge.net/projects/win32svn/ , which was suggested in another answer.
This is the closest solution to the original, pre-Apache binary. I've been using it without problems for the last two-three years.
http://subversion.tigris.org/
The client-side binaries ship with the source, as well as several other packaged installers.
The Command Line Client from CollabNet, while it does have an installer for windows, all it asks you is where you want to put the files, and then finish. Its just the command line client, like it says, nothing else. Subversion doesn't distribute their own binaries.
The Subversion project does not
officially endorse or maintain any
binary packages of the Subversion
software. However, volunteers have
created binary packages for different
distributions and platforms, and as a
convenience, we maintain a list of
links to them here. If there are any
problems with or questions about the
different binary packages please send
email to the Subversion users mailing
list.
I've successfully downloaded the binaries in a zip file and used them on windows w/o administrator access from here:
http://sourceforge.net/projects/win32svn/
As already suggested, take a look at the official Apache Subversion Binary Packages page.
If you are looking for zipped binaries of the latest Subversion command-line tools, you can get them at http://www.visualsvn.com/downloads/ (!) without any registration.
Portable binaries can also be found at:
http://www.smartsvn.com/download#svn

Resources