Warning

Warning

 

Installing Memcached on Windows

How to Remove A Service Entry From Win10 Service List。原稿链接

 

Submitted by COMMASTER21JAN ’15

Memcached is a high performance, in-memory key-value store or caching
system. Its main purpose is to speed up web applications by caching
database queries, contents, or other computed results.

Memcached is originally a linux application, but since it is
open-source, it has been compiled for windows. There are two major
sources for the pre-built windows binary: Jellycan and Northscale, and
both versions can be used. The following are the download links for the
memcached windows binaries:

In versions earlier than 1.4.5, memcached can install itself as a
service. However, the ability to run memcached as a service is removed
since version 1.4.5. Therefore, the installation steps are divided into
two categories, part A for memcached prior to version 1.4.5. and part B
for memcached version 1.4.5 and later.

Please do this operation CAREFULLY, otherwise you may get something
wrong with your system.

Please do this operation CAREFULLY, otherwise you may get something
wrong with your system.

卸载的还要删除日志,卸载的时等候法庭判决断程序是或不是正在运维,regsvr32

A) Installation of memcached < 1.4.5:

  1. Extract the memcached windows binary to any directory.
  2. In versions earlier than 1.4.5, memcached can install itself as a
    service. Run a command prompt with elevated
    privileges,
    and type:

    c:\memcached\memcached.exe -d install
    

    * Replace c:\memcached\memcached.exe with the actual path of
    your installation.

  3. Then, start or stop the memcached service with the following
    command:

    c:\memcached\memcached.exe -d start
    c:\memcached\memcached.exe -d stop
    
  4. To change the configuration of memcached, run regedit.exe and
    navigate to the key
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached“.
    Suppose you wish to increase the memory limit of memcached, edit the
    value of ImagePath to the following:

    "c:\memcached\memcached.exe" -d runservice -m 512
    

    * Besides ‘-m 512‘, you may also append other memcached
    parameters to the path. Run “c:\memcached\memcached.exe -h” to
    view the list of available parameters.

  5. Meanwhile, to uninstall the memcached serivce, run the following
    command:

    c:\memcached\memcached.exe -d uninstall
    

 

 

 

B) Installation of memcached >= 1.4.5:

  1. Extract the memcached windows binary to any directory.
  2. In version 1.4.5 or later, memcached cannot run as a service. It
    must be started as a normal process using the task scheduler. To
    configure the memcached process to run automatically every time
    windows start, run a command prompt with elevated
    privileges,
    and type the following:

    schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"
    

    * Replace c:\memcached\memcached.exe with the actual path of
    your installation.
    ** Besides ‘-m 512‘, you may also append other memcached
    parameters to the path. Run “c:\memcached\memcached.exe -h” to
    view the list of available parameters.

  3. Meanwhile, to remove the scheduled memcached task, run the following
    command:

    schtasks /delete /tn memcached
    

 

When we install application into win10, some of them will register their
services into windows service list to keep some part of the application
available as a daemon. But later when we uninstall the applications,
these application-related service entries may be left behind due to a
failure of uninstallation. Don’t worry, we can easily remove those
unnecessary service entries with win10 cmd.

When we install application into win10, some of them will register their
services into windows service list to keep some part of the application
available as a daemon. But later when we uninstall the applications,
these application-related service entries may be left behind due to a
failure of uninstallation. Don’t worry, we can easily remove those
unnecessary service entries with win10 cmd.

1.卸载程序的时候什么判定程序是不是正在运营

Integrating with PHP

To interface with memcached in PHP, you need to install the memcache
extension for PHP:

  1. Check that your PHP extension folder has the file php_memcache.dll.
    If not, download the file
    from  (select the windows dll
    file), and place it in the PHP extension folder.
  2. Add the following line in php.ini to enable the memcache
    extension.
    extension=php_memcache.dll
  3. Create this simple php script file to test that it works.

    <?php
    
    $memcache = new Memcache;
    $memcache->connect('localhost', 11211) or die ("Could not connect");
    
    $version = $memcache->getVersion();
    echo "Server's version: ".$version."<br/>\n";
    
    $tmp_object = new stdClass;
    $tmp_object->str_attr = 'test';
    $tmp_object->int_attr = 123;
    
    $memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
    echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
    
    $get_result = $memcache->get('key');
    echo "Data from the cache:<br/>\n";
    
    var_dump($get_result);
    
    ?> 
    

Please see the following screenshot:

Please see the following screenshot:

Integrating with Python

To interface with memcached in Python, you need to install the memcached
client for Python.

  1. Execute one of the following command to install the memcached
    client. The first is for Python 2.x while the second is for Python
    3.x.

    pip install python-memcached
    pip install python3-memcached
    
  2. Create this simple python script to test that it works.

    import memcache
    mc = memcache.Client(['127.0.0.1:11211'], debug=0)
    mc.set("some_key", "Some value")
    value = mc.get("some_key")
    mc.set("another_key", 3)
    mc.delete("another_key")
    mc.set("key", "1")   # note that the key used for incr/decr must be a string.
    mc.incr("key")
    mc.decr("key")
    

澳门金沙国际 1

澳门金沙国际 2

 

Memcached statistics

To view the statistics for memcached, bring up a telnet connection to
memcached by the command:

telnet 127.0.0.1 11211

Then, type stats and enter.

Here is an explanation of the different memcached stats.

Name Type Meaning
pid 32u Process id of this server process
uptime 32u Number of secs since the server started
time 32u current UNIX time according to the server
version string Version string of this server
pointer_size 32 Default size of pointers on the host OS (generally 32 or 64)
rusage_user 32u.32u Accumulated user time for this process (seconds:microseconds)
rusage_system 32u.32u Accumulated system time for this process (seconds:microseconds)
curr_items 32u Current number of items stored
total_items 32u Total number of items stored since the server started
bytes 64u Current number of bytes used to store items
curr_connections 32u Number of open connections
total_connections 32u Total number of connections opened since the server started running
connection_structures 32u Number of connection structures allocated by the server
reserved_fds 32u Number of misc fds used internally
cmd_get 64u Cumulative number of retrieval reqs
cmd_set 64u Cumulative number of storage reqs
cmd_flush 64u Cumulative number of flush reqs
cmd_touch 64u Cumulative number of touch reqs
get_hits 64u Number of keys that have been requested and found present
get_misses 64u Number of items that have been requested and not found
delete_misses 64u Number of deletions reqs for missing keys
delete_hits 64u Number of deletion reqs resulting in an item being removed.
incr_misses 64u Number of incr reqs against missing keys.
incr_hits 64u Number of successful incr reqs.
decr_misses 64u Number of decr reqs against missing keys.
decr_hits 64u Number of successful decr reqs.
cas_misses 64u Number of CAS reqs against missing keys.
cas_hits 64u Number of successful CAS reqs.
cas_badval 64u Number of CAS reqs for which a key was found, but the CAS value did not match.
touch_hits 64u Numer of keys that have been touched with a new expiration time
touch_misses 64u Numer of items that have been touched and not found
auth_cmds 64u Number of authentication commands handled, success or failure.
auth_errors 64u Number of failed authentications.
evictions 64u Number of valid items removed from cache to free memory for new items
reclaimed 64u Number of times an entry was stored using memory from an expired entry
bytes_read 64u Total number of bytes read by this server from network
bytes_written 64u Total number of bytes sent by this server to network
limit_maxbytes 32u Number of bytes this server is allowed to use for storage.
threads 32u Number of worker threads requested. (see doc/threads.txt)
conn_yields 64u Number of times any connection yielded to another due to hitting the -R limit.
hash_power_level 32u Current size multiplier for hash table
hash_bytes 64u Bytes currently used by hash tables
hash_is_expanding bool Indicates if the hash table is being grown to a new size
expired_unfetched 64u Items pulled from LRU that were never touched by get/incr/append/etc before expiring
evicted_unfetched 64u Items evicted from LRU that were never touched by get/incr/append/etc.
slab_reassign_running bool If a slab page is being moved
slabs_moved 64u Total slab pages moved
crawler_reclaimed 64u Total items freed by LRU Crawler
lrutail_reflocked 64u Times LRU tail was found with active ref. Items moved to head to avoid OOM errors.
Name Type Meaning

Source: 

 

另,stackoverflow:

North Scale labs have released a build of memcached 1.4.4 for Windows
x64:

UPDATE: they have recently released Memcached Server – still FREE but
enhanced distro with clustering, web-based admin/stats UI etc. (I’m not
related to them in any way) Check it out
at  and download
at: 

UPDATE 2: NorthScale Memcached is no longer available as a standalone
download. Now they have made it part of their commercial No-SQL DB
offering called Membase. It can be configured to run in Memcached-only
mode (i.e. without persistence) and there’s a 100% free version too.
Check it out here: 

UPDATE 3: MemBase has slept with CouchDB and produced a hybrid product
offering, called CouchBase. They still do offer a free “Community”
version at 

I will show you how to remove the service “wwbizsrv” from the list as an
example.

I will show you how to remove the service “wwbizsrv” from the list as an
example.

 2.威胁删除安装目录

Step1: Open cmd console with Administrator permission.

澳门金沙国际 3

Step1: Open cmd console with Administrator permission.

澳门金沙国际 4

Step2: Enter the cmd line shown as below, and execute it.

sc delete wwbizsrv

澳门金沙国际 5

Step3: Go back to the service list window to check if the service entry
have been removed successfully.

澳门金沙国际 6

Something go wrong! The service “wwbizsrv” is still in the service list.
Why? Okay, there is one more thing I forgot to mention — “stop the running service“.

Information

If the service that you are going to remove is running, you can remove
it by the cmd line. And after that, don’t forget to stop the service in
the service list dialog. The service entry will be gone as long as it
stops running.

See, the service entry is gone forever.

Now, I have to bring my wwbizsrv service
back 澳门金沙国际 7

Step2: Enter the cmd line shown as below, and execute it.

sc delete wwbizsrv

澳门金沙国际 8

Step3: Go back to the service list window to check if the service entry
have been removed successfully.

澳门金沙国际 9

Something go wrong! The service “wwbizsrv” is still in the service list.
Why? Okay, there is one more thing I forgot to mention — “stop the running service“.

Information

If the service that you are going to remove is running, you can remove
it by the cmd line. And after that, don’t forget to stop the service in
the service list dialog. The service entry will be gone as long as it
stops running.

See, the service entry is gone forever.

Now, I have to bring my wwbizsrv service
back 澳门金沙国际 10

 

 3.注册以及注销ocx控件

 

Flags:

restartreplace

When an existing file needs to be replaced, and it is in use (locked) by
another running process, Setup will by default display an error message.

This flag tells Setup to instead register the file to be replaced the
next time the system is restarted (by calling MoveFileEx or by creating
an entry in WININIT.INI).

When this happens, the user will be prompted to restart their computer
at the end of the installation process.

 

NOTE: This flag has no effect if the user does not have administrative
privileges.

Therefore, when using this flag, it is recommended that you leave the
PrivilegesRequired
[Setup] section directive at the default setting of admin.

 

regserver

Register the DLL/OCX file.

With this flag set, Setup will call the DllRegisterServer function
exported by the DLL/OCX file, and the uninstaller will call
DllUnregisterServer prior to removing the file.

When used in combination with sharedfile, the DLL/OCX file will only be
unregistered when the reference count reaches zero.

On a 64-bit
mode
install, the file is assumed to be a 64-bit image and will be registered
inside a 64-bit process.

澳门金沙国际,You can override this by specifying the 32bit flag.

See the Remarks at the bottom of this topic for more information.

 

设置前卸载在此之前的版本

I have used the following. I’m not sure it’s the simplest way to do it
but it works.

This uses {#emit SetupSetting("AppId")} which relies on the Inno Setup
Preprocessor. If you don’t use that, cut-and-paste your App ID in
directly.

上面包车型地铁代码,是帕斯Carl Script

/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
  sUnInstPath: String;
  sUnInstallString: String;
begin
  sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
  sUnInstallString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
  Result := sUnInstallString;
end;


/////////////////////////////////////////////////////////////////////
function IsUpgrade(): Boolean;
begin
  Result := (GetUninstallString() <> '');
end;


/////////////////////////////////////////////////////////////////////
function UnInstallOldVersion(): Integer;
var
  sUnInstallString: String;
  iResultCode: Integer;
begin
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString

  // default return value
  Result := 0;

  // get the uninstall string of the old app
  sUnInstallString := GetUninstallString();
  if sUnInstallString <> '' then begin
    sUnInstallString := RemoveQuotes(sUnInstallString);
    if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
      Result := 3
    else
      Result := 2;
  end else
    Result := 1;
end;

/////////////////////////////////////////////////////////////////////
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if (CurStep=ssInstall) then
  begin
    if (IsUpgrade()) then
    begin
      UnInstallOldVersion();
    end;
  end;
end;

 

干净卸载

贴吧里看看的,如何卸载干净

[UninstallRun]
Filename: “{cmd}”; Parameters: “/c rd /s /q “”{app}”””; Flags:
hidewizard runhidden

Filename (Required)
The program to execute, or file/folder to open.

If Filename is not an executable (.exe or .com) or batch file (.bat or
.cmd), you must use the shellexec flag on the entry. This parameter can
include constants.

Parameters
Optional command line parameters for the program, which can include
constants.

hidewizard
If this flag is specified, the wizard will be hidden while the program
is running.

runhidden
If this flag is specified, it will launch the program in a hidden
window. Never use this flag when executing a program that may prompt for
user input.

 

cmd /c 
/C Carries out the command specified by the string and then
terminates.

rd命令
指令表达:rd命令唯有一个参数,分别是/s和/q。
/s参数的法力是除目录本人外,还将去除钦点目录下的全数子目录和文书。用于删除目录树。假设不带这些参数就不得不删除空文件夹。
/q参数的职能是平静形式,带/s删除目录树时不必要肯定。

[UninstallDelete]
Name: {app}; Type: filesandordirs

Name  (Required)

Name of the file or directory to delete.

NOTE: Don’t be tempted to use a wildcard here to delete all files in
the {app} directory. Doing this is strongly recommend against for two
reasons.

First, users usually don’t appreciate having their data files they put
in the application directory deleted without warning (they might only be
uninstalling it because they want to move it to a different drive, for
example). It’s better to leave it up to the end users to manually remove
them if they want.

Also, if the user happened to install the program in the wrong directory
by mistake (for example, C:\WINDOWS) and then went to uninstall it
there could be disastrous consequences. So again, DON’T DO THIS!

 

Type  (Required)

filesandordirs

Functions the same as files except it matches directory names also,
and any directories matching the name are deleted including all files
and subdirectories in them.

 

 

OnlyBelowVersion

Format:  major.minor

Default value:0

Description:

This directive lets you specify a minimum version of
Windows that
your software will not run on. Specifying “0” means there is no upper
version limit. Build numbers and/or service pack
levels may be
included.

This directive is essentially the opposite
of MinVersion.

For compatibility with previous versions of Inno Setup, separate Windows
95/98/Me and Windows NT version numbers may be specified, separated by a
comma. Example: OnlyBelowVersion=0,6.0. The Windows 95/98/Me version
number (the first number) isn’t used, however, as Inno Setup no longer
supports Windows 95/98/Me.

 

 

Windows Versions

5.0.2195 Windows 2000
5.1.2600 Windows XP
or Windows XP 64-Bit Edition Version 2002 (Itanium)
5.2.3790 Windows Server 2003
or Windows XP x64 Edition (AMD64/EM64T)
or Windows XP 64-Bit Edition Version 2003 (Itanium)
6.0.6000 Windows Vista
6.0.6001 Windows Vista with Service Pack 1
or Windows Server 2008
6.1.7600 Windows 7
or Windows Server 2008 R2
6.1.7601 Windows 7 with Service Pack 1
or Windows Server 2008 R2 with Service Pack 1
6.2.9200 Windows 8
or Windows Server 2012
6.3.9200 Windows 8.1
or Windows Server 2012 R2
6.3.9600 Windows 8.1 with Update 1
10.0.10240 Windows 10

 

 

 

 

 

 

 

 

 

 

 

 

Note that there is normally no need to specify the build numbers (i.e.,
you may simply use “6.2” for Windows 8).

 

相关文章