You can reinstall the latest version when it is unavailable or when you reinstall the system.
However, you need to click the Next button several times for each installation and provide the serial number, ID, and other information. I hate this type of repetitive work. Simply write a small script and let it automatically install it.
I can. I have a few minutes of rest during installation.
The script uses Python 2.3 + Com objects, so your system must install Python or later.
The Mark Hammond's Win32all module must also be installed.
(Special thanks to Mark Hammond for developing the super module Win32all. He also expressed his gratitude to the talented Python Development Team for creating the amazing Python language)
The script is easy to use. During the first run, use RisingInstall. py-c RisingInstall. cfg in the command line.
Create a configuration file in the same directory, open it, modify sn, id, path, execpath, fill in the serial number, id number, and installation path respectively,
And the Directory and name of the installer
Run RisingInstall. Py.
Copy codeThe Code is as follows: ######################################## ##############################
# Create By WormChocolate
# RisingInstall. py Version Beta 1
#
# Test Wscript. Shell Object's Install Rising-Setup in Python
######################################## ##############################
Import win32com. client, time, OS, sys, ConfigParser
Wsh = win32com. client. Dispatch ("Wscript. Shell ")
Def InstallRising (ConfigFileName = "RisingInstall. cfg "):
If OS. path. exists (ConfigFileName ):
Cfg = ConfigParser. ConfigParser ()
Cfg. read (ConfigFileName)
Try:
Sn = cfg. get ("Install", "sn ")
Id = cfg. get ("Install", "id ")
Installpath = cfg. get ("Install", "path ")
Execpath = cfg. get ("Install", "execpath ")
Splashsec = int (cfg. get ("Program", "splashsec "))
Languagesec = int (cfg. get ("Program", "languagesec "))
Itemsec = int (cfg. get ("Program", "itemsec "))
Wshe = wsh. Exec (execpath)
Pid = wshe. ProcessID
Except t:
Print "ConfigParser faile"
Sys. exit (1)
If pid! = "":
Wsh. AppActivate (pid)
Time. sleep (splashsec)
Wsh. SendKeys ("{ENTER }")
Time. sleep (languagesec)
Wsh. SendKeys ("% n ")
# Time. sleep (itemsec)
Wsh. SendKeys ("% ")
# Time. sleep (itemsec)
Wsh. SendKeys ("% n ")
# Time. sleep (itemsec)
Wsh. SendKeys (sn)
# Time. sleep (itemsec)
Wsh. SendKeys (id)
Wsh. SendKeys ("% n ")
Time. sleep (itemsec)
Wsh. SendKeys ("% s ")
Time. sleep (itemsec)
Wsh. SendKeys ("% n ")
Time. sleep (itemsec)
Wsh. SendKeys ("% n ")
Time. sleep (itemsec)
Wsh. SendKeys (installpath)
Wsh. SendKeys ("% n ")
Time. sleep (itemsec)
Wsh. SendKeys ("% n ")
Wsh. SendKeys ("% n ")
Else:
Print "Config File" + ConfigFileName + "Not Found"
Print "Now Auto Create This Config File Dot't Worry"
CreateCfg (ConfigFileName)
InstallRising ()
Def CreateCfg (partition name ):
If your name! = "":
Print "Createing Config File:" + your name + "..."
Contents = ["[Install] \ n", "sn = \ n", "id = \ n", "path = c: \\\\ Program Files \\\\ rising \\\ Rav \ n "," execpath = c :\\\ rising172.166.exe \ n "\
"\ N [Program] \ n", "splashsec = 20 \ n", "languagesec = 2 \ n", "itemsec = 1 \ n"]
Cfg = open (partition name, "w + t", 256)
Cfg. writelines (contents)
Cfg. close ()
Print response name + "Create OK ..."
# ----- Main -------------
If len (sys. argv) = 1:
InstallRising ()
Elif len (sys. argv) = 2:
InstallRising (sys. argv [1])
Elif len (sys. argv) = 3:
If sys. argv [1] = "-c" and sys. argv [2]! = "":
CreateCfg (sys. argv [2])
Print "Config File:" + sys. argv [2] + "Created OK ..."
Else:
Print "Parm Error: \ nExample:" + sys. argv [0] + "-c ConfigFileName. cfg"
Else:
Print "Script Error"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service