Author: nextgens
Date: 2007-05-09 14:34:26 +0000 (Wed, 09 May 2007)
New Revision: 13170

Modified:
   trunk/apps/new_installer/res/windows/bin/install_wrapper.cmd
Log:
new_installer: maybe fix the wininstaller problem

Modified: trunk/apps/new_installer/res/windows/bin/install_wrapper.cmd
===================================================================
--- trunk/apps/new_installer/res/windows/bin/install_wrapper.cmd        
2007-05-08 13:32:19 UTC (rev 13169)
+++ trunk/apps/new_installer/res/windows/bin/install_wrapper.cmd        
2007-05-09 14:34:26 UTC (rev 13170)
@@ -50,10 +50,21 @@

 @echo "Installing the wrapper"
 @echo  - Creating a user for freenet
- at set PASSWORD=FreeNet@%random%%random%@
+:: A ugly hack to workaround password policy enforcements
+ at set PASSWORD=%random%%random%
+:: remove the user, just in case...
+ at net user freenet /delete > NUL
+ at net user freenet %PASSWORD% /add /comment:"this user is used by freenet: 
do NOT delete it!" /expires:never /passwordchg:no /fullname:"Freenet dedicated 
user" > NUL
+ at if errorlevel 0 goto pwgenerated
+ at echo "Error while creating the freenet user! let's try something else..."
+:: try with a better password
+ at set PASSWORD=Freenet_0@%PASSWORD%-
 @net user freenet %PASSWORD% /add /comment:"this user is used by freenet: do 
NOT delete it!" /expires:never /passwordchg:no /fullname:"Freenet dedicated 
user"
-:: Force the password in case it's a re-installation
- at net user freenet %PASSWORD% > NUL
+ at if errorlevel 0 goto pwgenerated
+:: We shouldn't reach that point
+ at echo "The workaround is still not working! will install freenet to run as 
SYSTEM"
+ at goto registerS
+:pwgenerated
 @echo wrapper.ntservice.password=%PASSWORD%>> wrapper.conf

 @echo  - Hiding the freenet user from the login screen
@@ -74,6 +85,7 @@

 @echo  - Changing file permissions
 @cacls . /E /T /C /G freenet:f 2> NUL > NUL
+:registerS
 @echo  - Registering Freenet as a system service

 :: It's likely that a node has already been set up; handle it


Reply via email to